views:

257

answers:

1

How to store object or hashtable in cookies?

I am trying to store multiple values in hastable/class to the cookie in my asp.net mvc (C#) application.

How to do it?

+1  A: 

Can you serialize the object and then store it as a string? Might be of help to you.

Beginner
Serialized the object and also need to encode to avoid the error "A potentially dangerous Request.Cookies value was detected from the client" before adding cookie and decode and deserialize before using the cookie
Prasad