gwg has asked for the wisdom of the Perl Monks concerning the following question:
Greetings monks,
I would like to store some user settings in a cookie, and was wondering if anyone had any advice on methods for compressing and/or encoding the data, which would be in the form of a hash of arrays. Storing all possible settings using FreezeThaw to stringify the data gives a file of 402 bytes in size. The number and variety of compression and encoding modules is a bit overwhelming, so if anyone has any suggestions for a particularly suitable module, I would be most grateful!
Update / clarification:
I'm already using a local variant of CGI::Session to store data server-side. The problem is that there are two machines which run the program, and a user could be directed to either of the two (the sys admin says that each user is usually sent to the machine they were previously on, but it can't be guaranteed every time). The other thing is that the volume of users is such that it is not feasible to keep the session data for every person, and it would be better for users to be able to have their settings persist between sessions.
The data that I want to store isn't anything critical - there are five filters that users can set up for searching / viewing data, and it's these settings that I would like to put in the cookie. The cookie data would be compared against the list of valid parameters, so if users did have the inclination to tinker with the settings, the worst they could do would be to set the maximum possible filters, which you can do validly by setting those filters using the cgi.
Thanks,
gwg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compressing data structures for cookies
by Joost (Canon) on May 08, 2007 at 21:55 UTC | |
|
Re: Compressing data structures for cookies
by GrandFather (Saint) on May 08, 2007 at 22:19 UTC | |
|
Re: Compressing data structures for cookies
by Herkum (Parson) on May 08, 2007 at 23:15 UTC | |
by gwg (Beadle) on May 09, 2007 at 07:28 UTC | |
by Herkum (Parson) on May 09, 2007 at 11:31 UTC | |
by Anonymous Monk on May 13, 2007 at 21:20 UTC | |
|
Re: Compressing data structures for cookies
by Bro. Doug (Monk) on May 08, 2007 at 22:41 UTC | |
by gwg (Beadle) on May 09, 2007 at 08:02 UTC | |
|
Re: Compressing data structures for cookies
by grinder (Bishop) on May 09, 2007 at 08:53 UTC |