javascript - Password save in Cache/Cookie? -


is there way save input type "password" in cache?

so every time visit page, password should not required. skip next step

<input type="password" name="lock_password" /> 

i tried html5 localstorage fail.

older browsers not support html5 web storage

  • chrome: 4.0 or higher
  • ie: 8.0 or higher
  • ff: 3.5 or higher
  • opera: 11.5 or higher
  • safari: 4.0 or higher

saving pw can done this:

html

<input id="testpassword" type="password" name="lock_password" /> 

javascript

// check if local storage available if(typeof(storage) !== "undefined") {     // locale storage supported      // getting password input     var pw = document.getelementbyid("testpassword").value;      // saving password in local storage     localstorage.setitem("passwordkey", pw);      // test if password saved in local storage     alert(localstorage.getitem("passwordkey")); } else {     // no local storage available } 

jsfiddle


Comments