JQuery's cookie plug in implementation saves user login information

  • 2020-03-30 02:38:12
  • OfStack

<!DOCTYPE html> 

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 
<meta http-equiv="description" content="this is my page"> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 

<style type="text/css"> 
width: 150px; 
border: 1px blue solid; 
margin-bottom: 5px; 
padding-left: 5px; 

<script type="text/javascript" src="../js/jquery-1.10.2.js"></script> 
<script type="text/javascript" src="../js/jquery.cookie.js"></script> 
<script type="text/javascript"> 

//The value is assigned if it exists



//If the save username option is selected

//Set the Cookie value
expires:7,//Set a save period
path:"/"//Set the saved path



//Destruction of objects


return false; 


<form action="#" method="get" id="mycookie"> 

 User name: <br> 
<input id="username" name="username" type="text" class="txt"> 
 password :<br> 
<input id="password" name="password" type="password" class="txt"> 
<input id="chkSave" type="checkbox"> Whether to save the user name  
<input id="cookBtn" class="btn" type="submit" value=" submit "> 


Related articles: