Set,Read & Delete Cookie in Jquery

Recently in one of my project, I happened to use Cookie in Jquery. So, I though it would helpful for future references and to others also.

To set, read and delete cookie in Jquery I found this plugin very useful, you can download this from here,

http://plugins.jquery.com/cookie/

First include this plugin on your page by

To set a cookie

first parameter is the name of the cookie, which we will use further to read / delete, second parameter is the value for this cookie.

If we want a cookie to get expire after a time interval, we do this by setting time limit

Now this cookie will get expired after 5 days.

To read a cookie’s value, just pass the cookie name

To delete a cookie