Session Cookie Dialog Cache
Create a Dialog cache
$.cookie (' name ', ' value ');
Set the expiration time and whether the global
$.cookie (' name ', ' value ', {expiring:7,path: '/'});
Read cookies
$.cookie (); ----Read all available cookies
$.cookie (' name ')----Gets the cookie of name, if there is a return cookie value, there is no return undefined
Delete Cookies
$.removecookie (' name ')----Delete successfully returns TRUE if the deletion is a nonexistent cookie that returns false
If you set the value of a parameter in a cookie, you must include the parameter value when deleting
The different parameters represent different cookies.
Configuration
Raw
$.cookie.raw=true; ----is equivalent to using the Encodeuricomponent/decodeuricomponent
Json
$.cookie.json=true; ----whether to use json.stringify and Json.parse
Default Properties
Expiring:365 defines the life of a cookie if you do not set a cookie will become a dialog cache
Path: '/'----default is the path of the current page where the cookie was created
Domain: ' example.com '----default is the domain name of the current page where the cookie was created
Secure:true----Default is False, if true, use HTTPS to access
Conversion functions
$.cookie (' foo ', ' 42 ');
$.cookie (' foo ', number)----reads the Foo value and outputs the Read value in number form
$.cookie (' foo ', unescape)----do not use conversion functions
Cookie usage in jquery