jQuery - Cookie

jquery

How can we set a cookie?

$.cookie("cookieName", "value");
$.cookie("cookieName", "value", { expires: 7 });
$.cookie("cookieName", "value", { path: '/' });
$.cookie('cookieName', 'value', { path: '/', domain: 'www.example.com' });

How can we read the content of a cookie?

$.cookie("cookieName");

How can we delete a cookie?

$.cookie("cookieName", null);

http://www.electrictoolbox.com/javascript-get-all-cookies/

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License