I have a form that I would like to store values in a cookie so that the user does not have to re-enter the form in every visit. (A form is a few selections for filtering search results.)
I would like the cookie serialization to be easy to read from javascript (obviously to set the onLoad form), but I would also like to be able to read cookies easily with PHP (so that I can use the form data to filter the search results).
How would I start serializing a form with selections that have multiple = "multiple" set in a cookie, and is it easy to read in javascript and PHP?
Please do not preach about verification, I am doing it right on the server side.
If there is a more reasonable solution to my problem, please let me know.
BTW: I use CodeIgniter on the server and the prototype / Scriptaculous javascript libraries.
Solution: Used a prototype for javascript and used PHP to get an associative array in PHP from JSON.Object.toJSON( Form.serialize(form, true))json_decode(string, bool)
Ben s source
share