Reputation: 757
I have been writing a php script that saves a long string within cookie (more than 4000 chars long) and I want to save it within the browser cache. The problem is that almost all browsers have a limit. What should I do? I'm using jQuery for adding and reading data from cookie and php.
Upvotes: 3
Views: 5712
Reputation: 592
You can use HTML5 based concept of IndexDb to save data at client end.
www.tipstr.in/html5-learn-use-indexeddb
Upvotes: 2
Reputation: 1015
Use http://www.jstorage.info/ this will help you store lots of data without problems
Upvotes: 1
Reputation: 2625
You can use jQuery data method to store data:
http://api.jquery.com/jQuery.data/
jQuery itself uses this method to store information.
But this will not persist the data.
Why not store the information in a hidden field in the form? But that again is going to remain stored only until the browser is not closed.
Upvotes: 0
Reputation: 16636
Upvotes: 0
Reputation: 3397
Check out Web Storage Portability Layer: A Common API for Web Storage
It abstracts the various local storage mechanisms that browsers provide.
Local storage is becoming standardized in HTML5.
Upvotes: 1
Reputation: 25165
Rethink your App logic and save most of the data on server.
This will save you a lot of hassle in the long run.
Just my two cents.
Upvotes: 4
Reputation: 10333
I know your looking for a JQuery solution, but perhaps this will give you a starting point to look for a JQuery option. Its html 5 data storage on the client side. 10 megs in IE, and 5 megs in all other browsers. I believe yahoo has a solution in theirs for non-HTML 5 browsers.
http://developer.yahoo.com/yui/storage/
Upvotes: 0