开发者

Classic Asp: Cookie corruption issue

开发者 https://www.devze.com 2023-02-12 03:22 出处:网络
There is an ASP application made to co-exist with other .net web apps. The cookies for the asp page is actually written to the client from an aspx page. So we have something like:

There is an ASP application made to co-exist with other .net web apps. The cookies for the asp page is actually written to the client from an aspx page. So we have something like:

Response.Cookies("Credo")("ID") = "ido sans lum"

sent to the client.

The ASP page receives this cookie, but strangely gives corrupt results:

sID = Request.Cookies("Credo")("ID") ' this gives "idosanslum"

Unfortunately I don't understand why.开发者_StackOverflow中文版 I checked HTTP_COOKIE server variable in ASP, and even it said something like:

HTTP_COOKIE:...;Credo=ID=ido sans lum&DomainID=5&...;...

So I believe this means the cookie is being sent from the browser correctly, but Request.Cookies("Credo")("ID") is giving me wrong results.

Am I messed up with some configuration or is this a known bug.


There is a KB article on this problem at the Microsoft support site: http://support.microsoft.com/kb/262444

Hope this helps.

Update: The proposed fix from the article is to encode your cookie content. In Classic ASP I think the following will work:

Response.Cookies("Credo")("ID") = Server.URLEncode("ido sans lum")

Please give it a go and let me know what you find.

0

精彩评论

暂无评论...
验证码 换一张
取 消