パスワードのautocomplete対策について

パスワードをautocompleteさせたくないときのメモ。

案1.formにautocomplete=”off”を定義してみる。
結果はNGでした。 普通にパスワードが設定されてました。
案2.input type=”password”をtype=”text”に変更してみる。
結果はOKでした。パスワードは設定されませんでしたが、パスワードっぽくない。
案3.案2をやったあとにwindow.onload後にinput type=”password”に変更してみる。
結果はNGでした。パスワードが設定されている状態でした。
案4.案3を改良して、少しdelayをかけてからinput type=”password”に変更してみる。
結果はOKでした。これが一番まともな気がします。

こんな感じにするとうまく動作しました。

参考サイト
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q13146625208
https://developer.mozilla.org/ja/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion


One comment to this article

コメントを残す