jQuery Cookie Example

In this article I will show you how to set, Get, delete and edit cookie with jQuery.
First of all we need jQuery library (jquery-1.3.2.min.js) or any latest version and jQuery Cookie plugin (jquery.cookie.js) which you can download from here
Set Cookie

Get value of Cookie

delete Cookie:

Additionally, to set a timeout of a certain number of days (10 here) on the cookie:

Note: If the expires option is omitted, then the cookie becomes a session cookie, and is deleted when the browser exits.

To cover all the options:




2 responses to “jQuery Cookie Example”

  1. thnx for ur efforts in trying such example but i copy paste this sample and it’s not work, when i enter value and i press set then get , i get null value even of that the expiration period is 10 days.

Leave a Reply