1.

How to create, read and delete cookies with jQuery?

Answer» 1. Set a cookie

$.cookie("example", "foo"); // Sample 1
$.cookie("example", "foo", { EXPIRES: 7 }); // Sample 2
$.cookie("example", "foo", { path: '/admin', expires: 7 }); // Sample 3

2. Get a cookie

alert( $.cookie("example") );

3. DELETE the cookie

$.removeCookie("example");



Discussion

No Comment Found