Last post Mar 29, 2012 05:15 PM by roopeshreddy
Mar 23, 2012 03:04 PM|ojm37|LINK
I have a website that is still a mix of classic asp and asp.net (web forms). It's running on Windows Server 2008 R2, with IIS 7.5 and dot-net 4.0 Integrated Mode.
To set a particular cookie on the classic ASP side, I have something like the following:
Response.Cookies("CookieName") = "Test.02"
To set the same cookie on the dot-net side, I have the follwoing code:
Response.Cookies("CookieName").Value = "Test.02"
The strange thing that's happening is, for example, when I have a value for the cookie such as "Test.02". The dot-net code sets the value of the cookie (verified using Fiddler) to "Test.02". However, the classic asp sets the cookie value to "Test%2E02".
Anyone know why? AND, more importantly, how I can get the classic asp to write the cookie un-munged (url encoded)?
Mar 26, 2012 03:36 PM|ojm37|LINK
Interesting. Did some more google searching and it looks like classic asp always URLencodes the cookies (names AND values), where asp.net does not. Why did this change? I'm surprised we never really ran into this before... Seems strange that classic asp
CHANGES the value that I set and then does not change it back when I read it.
Mar 26, 2012 03:55 PM|BrockAllen|LINK
Well, if you always decode it when you read it, then you'll be fine (although it feels like an extra step).
Mar 29, 2012 05:15 PM|roopeshreddy|LINK
Incase of Classic ASP, URL is encoded by default, where as in ASP.NET it allows the choice to user! If required he can encode!
Hope it helps u...