Reputation: 103507
I need to store a cookie that has the following information:
key1: datetime key2: datetime key3: datetime
How can i create and access the cookie with the above properties?
I need to manipulate this cookie via javascript (I am using jquery).
(side question, javascript cookie work is 'live' correct? i.e. it doesn't need a postback to change cookie values etc?)
Upvotes: 5
Views: 18944
Reputation: 29976
You don't need jQuery to read/write cookies. You can use plain javascript. Some good examples are here: http://www.quirksmode.org/js/cookies.html
You can use this jQuery plugin to make getting and setting cookies a little easier:
Upvotes: 12
Reputation: 359816
jQuery Cookies plugin makes life easy.
Cookies live on the client's computer, not the server. There is no need to postback when manipulating cookies.
Upvotes: 2