Reputation: 8379
I am using cookies to store data at client end for later access. But my concern is I am unable to set more than 20 cookies and I am looking for alternative to cookies.
Please help me on this
Updated
I found jStorage plugin here But it does not work for me in this case..
Upvotes: 7
Views: 13446
Reputation: 4329
You can leverage local/session storage of HTML5
To save a value:
localStorage.name = "Bob";
To get a value:
alert(localStorage.name);
http://www.w3.org/TR/webstorage/
Upvotes: 10
Reputation: 4015
There are few alternatives to cookies
Session (server side)
If HTML5 compliant browser then you can even have client side database
Upvotes: 1
Reputation: 7881
Are you storing one piece of information in each cookie? Because you could use JSON serialization to store more data in each individual cookie.
Upvotes: 2
Reputation: 17010
You can store only one cookie representing a session ID (for example, an alfanumeric randomly generated long string). Then you just need a database to store all your data (that now is on 20 cookies) together with that session ID. At runtime, you read from the only cookie the session ID, and load from the DB all data.
Upvotes: -3