Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
92
rated 0 times [  98] [ 6]  / answers: 1 / hits: 31695  / 14 Years ago, wed, december 1, 2010, 12:00:00

I'm using the jQuery cookie plugin to read/write/delete cookies. I'm using cookies to store points on a graph that the user plotted on top of a canvas. I'm allowing the user to store the plotted points along with a name in the cookie, I'm also listing the saved cookies so that they can redraw their saved points on the graph.



I was originally saving and reloading the points from cookies by naming each cookie with a sequential number $.cookie(_1), $.cookie(_2), etc and this worked. Problems start when user deletes a cookie and the sequential numbering breaks.



I would like to save the cookie using the name that the user gives to the plotted points, so basically saving cookies with arbitrary names. If I do this is it possible to read all domain cookies if I don't know their names?


More From » jquery

 Answers
17

You don't need jQuery for this. You can read all your cookies by accessing document.cookie and parsing accordingly.



See an example here.


[#94777] Monday, November 29, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
trinity

Total Points: 591
Total Questions: 102
Total Answers: 106

Location: Singapore
Member since Sun, Jul 25, 2021
3 Years ago
;