Wednesday, October 28, 2009

Write Cookie without Encode from ASP

In ASP, if you using Server.Cookie to add or change any cookie, the name and value of the cookie will be urlencode by ASP automatically. So if you call Server.Cookie("my.cookie") = "my_cookie", then on the browser, you will get my%2Ecookie = my%5Fcookie.

So you can use Response.AddHeader "Set-Cookie", "my.cookie=my_cookie" and you will get exact the name and value on your browser.

No comments: