When verifying the jquery cookie plugin, it is only known that the original file has been placed on the desktop to perform the discovery is not effective, the file must be placed under the Web server execution will not take effect, the halo dish!
$.cookie (name,value,{expires:7,path: '/', Domin: ' jquery.com ', secure:true})
Detailed parameters:
expires:7,//a finite date, either an integer or a date (in days) if omitted, the cookie created is a session cookie that will be deleted when the user exits the browser. Path : '/',//cookie the saved path is the same as creating the page path by default domin: ' jquery.com ',//cookie domain property default range Create page path consistent secure:true//a Boolean value Indicates whether a security protocol is required to transmit a cookie
1. Read cookies
$.cookie (' The_cookie '); Get Cookie Value
2. Setting cookies
$.cookie (' The_cookie ', ' the_value '); Set cookies
3. Set cookie value with expiration date
$.cookie (' The_cookie ', ' The_value ', {expires:7}); Set cookies with time 7 days to save time
4. Delete Cookies
$.cookie (' The_cookie ', ', {Expires:-1}); Delete
$.cookie (' The_cookie ', null); Delete Cookies
5. Create a new cookie including the validity path domain name, etc.
$.cookie (' The_cookie ', ' The_value ', {expires:7, path: '/', Domain: ' jquery.com ', secure:true});
Notice to delete cookies:
@1.$.cookie (Name,null) when destroying a cookie, the path and domain name in its optional parameters must be the same as when it was set up or it cannot be destroyed
jquery Action Cookie