Tags

, ,

To get/set/delete cookies in jQuery, for this you can use jQuery Cookie plugin

Here is how to use jQuery Cookie plugin in your code:

// Setting a cookie
$.cookie('myCookie':'myValue');

// Creating cookie with all availabl options
$.cookie('myCookie1', 'myValue1', { expires: 7, path: '/', 
domain: 'avinash6784.wordpress.com', secure: true });

// Get a cookie
$.cookie('myCookie');

// Delete a cookie
$.cookie('myCookie', null);
Advertisements