// Verify that the password is remembered during page Initialization
$ (Document). Ready ( Function (){
If ($. Cookie ("rmbuser") = "true "){
$ ("# Rmbuser"). ATTR ("checked ", True );
$ ("# User"). Val ($. Cookie ("username "));
$ ("# Pass"). Val ($. Cookie ("password "));
}
}); // Save User Information
Function Saveuserinfo (){
If ($ ("# Rmbuser"). ATTR ("checked") = True ){
VaR Username = $ ("# user"). Val ();
VaR Password = $ ("# Pass"). Val ();
$. Cookie ("rmbuser", "true", {expires: 7 }); // Store a cookie with a 7-day validity period
$. Cookie ("username", username, {expires: 7 }); // Store a cookie with a 7-day validity period
$. Cookie ("password", password, {expires: 7 }); // Store a cookie with a 7-day validity period
}
Else {
$. Cookie ("rmbuser", "false", {expires:-1 });
$. Cookie ("username", '', {expires:-1 });
$. Cookie ("password", '', {expires:-1 });
}
}
// The most important linesCode:
$. Cookie (the _ cookie '); // Read cookie
$. Cookie (the _ cookie, The _ value); // store the cookie
$. Cookie (the _ cookie, The _ value, {expires: 7 }); // Store a cookie with a 7-day validity period
$. Cookie (the _ cookie ', '', {expires:-1 }); // Delete cookie
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.