views:

148

answers:

1

When storing a value in a cookie using C#, what is the best way to encode (or escape) the value so that it can be retrieved and decoded/unescaped reliably?

I'm not talking about encryption.

+2  A: 

Well, the safest thing to do is use UrlEncoding (use HttpServerUtility.UrlEncode).

Tom Cabanski
UrlEncode... that's what I was looking for. Cheers.
Paul Lucas