Asp – Serializing a Dictionary for cookies

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: