create, read, and erase cookies with jquery [duplicate]

Set a cookie

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

Get a cookie

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

Delete the cookie

$.removeCookie("example");

Comments

Popular posts from this blog

What is the difference between asynchronous and synchronous execution?

Yahoo accepting requests for inactive email IDs

Tum Hi Ho Lyrics