Click here to Skip to main content
15,905,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a browser solution that needs to store quite a bit of data into cookies.
We talking about 1000+ entry points. Unfortunately most browsers have limitations if it comes to
cookie saving (i.e. Firefox 3 Mac OS 10.6.6 = 150 parameter per domain).

I also store the data in a MySQL database after the user clicks on the save button that he really wants to keep those data persistent.

The reason I designed it this way is to have:
A. a browser crash protection system in place, or the user closes the window/tab
B. it is convenient for the user to come back to the same page and continue working on his project

Please let me know your thoughts or suggestions on that.

Many thanks!
Posted

Couldn't you just save that data in the database into a LastSession table?
 
Share this answer
 
Comments
fjdiewornncalwe 19-Jan-11 17:43pm    
Agreed. Save the session in the db, and store the session id in the cookie.
It is not a limitation on the browser side. Read RFC2109 which states cookie limitations.

6.3  Implementation Limits
Practical user agent implementations have limits on the number and
   size of cookies that they can store.  In general, user agents' cookie
   support should have no fixed limits.  They should strive to store as
   many frequently-used cookies as possible.  Furthermore, general-use
   user agents should provide each of the following minimum capabilities
   individually, although not necessarily simultaneously:

      * at least 300 cookies

      * at least 4096 bytes per cookie (as measured by the size of the
        characters that comprise the cookie non-terminal in the syntax
        description of the Set-Cookie header)

      * at least 20 cookies per unique host or domain name


You best bet is to store the data in your db and then you can save your data id / key in the cookie.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900