I know that cookies are just text strings but I was hoping for a high level function that can intelligently parse a string and cast it to a dictionary, list, tuple, etc. It seems eval() might be applied here but there are issues with using eval. I have reevaluated my requirements and I don't really need to store this info in cookies and will use session variables instead where it is much easier to manipulate data. I appreciate everyones help on this matter. Thank you. Lennart Regebro wrote:
From: "Kashif Jabbar" <kjabbar@ssidecisions.com>
I am trying to store a dictionary in a cookie which I would like to retrieve later and use.
Cookies are stored by the clients. They have no idea what a python dictionary are. Do you really want to store it in a cookie, or do you just want to store ite temporarily? Because in the later case, using a session might be simpler.
Otherwise I maybe you can use "eval" to convert it back to a dictionary?