Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safe way to encode a cookie value in c#

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.

like image 497
Paul Lucas Avatar asked Apr 23 '10 17:04

Paul Lucas


Video Answer


1 Answers

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

like image 118
Tom Cabanski Avatar answered Sep 23 '22 19:09

Tom Cabanski