I am trying to store 1000KB (~1MB) of data in a cookie in JavasSript but it is not working.
How can I do this?
I am trying to store 1000KB (~1MB) of data in a cookie in JavasSript but it is not working.
How can I do this?
Don't do that. Sending a megabyte of data takes a lot of time (often more than a second). Keep some session status hidden inside your server. Then your cookie string is just a small opaque identifier which should be keyed by the server.
For IE, and I'm sure most other browsers, the limit is around 4K
For one domain name, each cookie is limited to 4,096 bytes
Instead of a cookie use localStorage.
https://developer.mozilla.org/en/DOM/Storage
http://en.wikipedia.org/wiki/Web_Storage
Most browsers allow 5mb per domain, but IE will give you 10mb per domain.