2

In angular if I use

$cookies.put('key','{somedata}');

in cookies it comes like %7Bsomedata%7D and when I access this from client side using $cookies.get('key'); Its returning {somedata}. But When i try to access it from server side using C# Request.Cookies["key"] Its returning %7Bsomedata%7D instead of {somedata}.

So I'm having issues when accessing these values in my c# code.

Please suggest me a way to set the cookie through angular so the I get the correct string in my C# code

Jojo
  • 403
  • 5
  • 16
  • Tried to reproduce your error. No success. Please have a look at this plnkr: [http://plnkr.co/edit/RiMXd6mRtByEHc0zxRz2?p=preview](http://plnkr.co/edit/RiMXd6mRtByEHc0zxRz2?p=preview). Is there any difference? And how are you sending this string to your server - I guess C# is your server side language? Are you using the $cookies.get()-function? – ilmgb Aug 06 '15 at 15:11
  • @ilmgb Your angular js code in plnkr is exactly same. My actual problem is When i try to access it from server side using C# Request.Cookies["key"] Its returning %7Bsomedata%7D instead of {somedata} . – Jojo Aug 06 '15 at 16:50
  • 1
    No experience with that, but a quick search what you try to achieve, found this, might help (I guess Decoding is what you are looking for) http://stackoverflow.com/questions/575440/url-encoding-using-c-sharp – ilmgb Aug 06 '15 at 17:06

0 Answers0