storing form preferences is cookies
Posted: Wed Feb 22, 2006 8:20 am
I've used cookies before, but I only use them to store one value.
However, I want to store a users search preferences so they don't have to fill out the form every time they visit the page. There are about 10 forms and I really don't want to store it in 10 separate cookies (i don't think there's a need to, right?)
So how could/should I go about doing this? Obviously I need to retain the field name along with the value chosen. That could get a little messy storing in plain text.
Should I choose a unique delimiter such as # and explode("#") when pulling the information back from the cookie?
What about storing it into an array and serializing it, then unserializing it upon pulling it back out?
What would the best way to go about this be.. or is it up to me?
However, I want to store a users search preferences so they don't have to fill out the form every time they visit the page. There are about 10 forms and I really don't want to store it in 10 separate cookies (i don't think there's a need to, right?)
So how could/should I go about doing this? Obviously I need to retain the field name along with the value chosen. That could get a little messy storing in plain text.
Should I choose a unique delimiter such as # and explode("#") when pulling the information back from the cookie?
What about storing it into an array and serializing it, then unserializing it upon pulling it back out?
What would the best way to go about this be.. or is it up to me?