FIX: Cookie Is Not Returned for ASP Page on Internet Information Services 5.1 (324337)
The information in this article applies to:
- Microsoft Active Server Pages
- Microsoft Internet Information Services version 5.1
This article was previously published under Q324337 SYMPTOMS
When a cookie is requested with the Request.Cookies collection in an Active Server Pages (ASP) page on Internet Information Services (IIS) 5.1, the cookie may not be returned.
CAUSE
If a cookie path is not explicitly added to the cookie when the cookie is added to the Response.Cookies collection in an ASP page, ASP automatically adds the cookie path. If the ASP page is not in the root Web site on the Web server, the path that is added includes the location of the ASP page relative to the root Web site.
Typically, the case (uppercase or lowercase) of the path that is added is the same as the case in the URL that was used to request the page. For example, suppose that cookietest is a subweb on a server that is named TestServer. You use the following URL to request the page:
http://TestServer/cookietest/test.asp
This sets the cookie in the browser and generates a cookie path of "/cookietest".
With ASP on IIS 5.1, ASP does not synchronize the case of this path with the case of URL. Instead, the case of the path matches the case of the associated directory in the file system. For example, if the test.asp file is located in the C:\Inetpub\wwwroot\CookieTest directory, a request to the same URL (http://TestServer/cookietest/test.asp) generates the cookie path of "/CookieTest". On a later request to http://TestServer/cookietest, the browser does not send the cookie because "cookietest" in the URL does not match the cookie path that is returned from IIS 5.1.
RESOLUTIONTo resolve this problem, obtain the latest service pack for Windows XP. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
322389 How to Obtain the Latest Windows XP Service Pack
WORKAROUND
To work around this behavior, use one of the following methods:
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows XP Service Pack 1 (SP1).REFERENCESFor additional informationabout cookies in ASP pages, click the article number below
to view the article in the Microsoft Knowledge Base:
302390 HOW TO: Use Cookies in an ASP Page
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | kbbug kbfix kbState kbWinXPsp1fix KB324337 |
---|
|