I'm kind of a beginner in javascript. I parsed my objects to store them in a cookie like this :
JSON.stringify(myObject)
but what do I do to turn the cookie's data back into my object? I'm missing something...
myObject=JSON.parse(myCookieData);
This is working now.
I'm still having a problem though: I store my cookie with onbeforeunload
but it sometimes not store it. I tried with onunload
too but I have the same problem. Does it take too much time to store the cookie? What is the problem?
Ok so I'm not using base64 anymore, just storing json'd objects in my cookie. My current problem is that the cookie is starting to grow in size badly... Sometimes it is too big to get stored.. How can I minimize the size?
I now use PersistJS. Thanks for your help.