Jquery.cookie Implementation Remember password function
$.cookie (' The_cookie '); Read cookies
$.cookie (' The_cookie ', ' the_value '); Store cookies
$.cookie (' The_cookie ', ' The_value ', {expires:7}); Store a cookie with a period of 7 days
$.cookie (' The_cookie ', ', {Expires:-1}); Delete Cookies
//Verify that the password is remembered when the page is initialized
$ (document). Ready (function () {
if ($.cookie ("rmbuser") = = "true") {
$ ("#rmbuser"). att R ("Checked", true);
$ ("#user"). Val ($.cookie ("username"));
$ ("#pass"). Val ($.cookie ("password"));
}
});
//Save user Information
Function saveuserinfo () {
if ($ ("#rmbuser"). attr ("checked") = = True) {
var username = $ ("#use R "). Val ();
var password = $ ("#pass"). Val ();
$.cookie ("Rmbuser", "true", {expires:7});//Store a cookie with a 7-day period
$.cookie ("username", username, {expires:7}) ; Store a cookie with a 7-day term
$.cookie ("Password", password, {expires:7});//Store a cookie with a 7-day expiration
}
else {
$.c Ookie ("Rmbuser", "false", {Expires:-1});
$.cookie ("username", "", {Expires:-1});
$.cookie ("Password", "", {Expires:-1});
}
}