Asp – Serializing a Dictionary for cookies

asp.net

What would be the best method for serializing a Dictionary for use in a single Cookie?

Best Solution

I don't recommend it, the performance of serializing/deserializing a cookie on every request is terrible.

Figure out a way to represent the structure yourself to/from a string.

If you absolutely must serialize it:

http://petesbloggerama.blogspot.com/2006/07/binary-serialization-to-from-string.html