FIX: Random Cookies Disappear When Different Cookie Is Set to Nothing in Internet Explorer 4 and 5 (232907)
The information in this article applies to:
- Microsoft Active Server Pages
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 4.01 SP1
- Microsoft Internet Explorer (Programming) 4.01 SP2
- Microsoft Internet Explorer (Programming) 5
This article was previously published under Q232907 SYMPTOMS
In Active Server Pages (ASP) pages, cookies appear to work but then suddenly "disappear." This occurs only when you view the pages with Microsoft Internet Explorer 4 and 5, not Internet Explorer 3.
If you loop through the Response.Cookies collection, you may see the name of the missing cookie separated by a semicolon from the name of a cookie that was set to an empty string.
CAUSE
Internet Information Server 4/Active Server Pages don't handle nameless cookies correctly. Nameless cookies get concatenated before the next cookie name. Consider the following valid cookie headers from the browser:
SomeNamelessValue;
cookie2=ABC;
You cannot use the following to get the value of cookie2:
Request.Cookies("cookie2")
Instead, you can use the following to get the value ABC:
Request.Cookies("SomeNamelessValue;cookie2")RESOLUTION
There are two workarounds for this problem:
- "Expire" the cookie.
- Set the cookie to some known value that means it is empty, and then test for that value in the code, instead of testing for an empty string.
STATUSThis problem was corrected in Windows NT 4 Service Pack 6.
| Modification Type: | Minor | Last Reviewed: | 9/23/2005 |
|---|
| Keywords: | kbHotfixServer kbQFE kbbug kbfix kbQFE KB232907 kbAudDeveloper |
|---|
|