DOCUMENT:Q265372 08-MAY-2002 [iis] TITLE :PRB: Different Cases Across ASP Collection Key Names Not Advised PRODUCT :Internet Information Server PROD/VER:winnt:4.0,5.0 OPER/SYS: KEYWORDS:kbDSupport kbiis400 kbiis500 kbWin2000PreSP2Fix ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Internet Information Server version 4.0 - Microsoft Internet Information Services version 5.0 ------------------------------------------------------------------------------- SYMPTOMS ======== The key names of the Active Server Pages (ASP) collections - ClientCertificate, Cookie, Form, and QueryString - are not case-sensitive. "MyVar" and "myvar" would reference the same collection. You should avoid using the same name with different cases for different ASP collections. For example, don't use "MyVar" for a cookie name and "myvar" for a form name. Depending on the ASP page, the form name in this case might be misunderstood as the cookie name, and the cookie pair myvar=aValue (not MyVar=aValue as expected) may be returned to the browsers in such a situation. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- Install the following three ASP pages on an Internet Information Server/Services server and browse to Page1.asp. Click submit, and then click Page3.asp. Although "cookie:SecondValue" should be returned, "cookie:firstValue" is returned instead. Page1.asp <% Response.Cookies("CookieName") = "firstValue" %>
Page2.asp <% myvar = Request.Form("CookieName") Response.Cookies("CookieName") = "Secondvalue" %> cookie: page3.asp Page3.asp <% Response.Write "cookie:" & Request.Cookies("CookieName") & "

" Response.Write "HTTP_COOKIE: " & Request.ServerVariables("HTTP_COOKIE") & "

" %> Additional query words: ====================================================================== Keywords : kbDSupport kbiis400 kbiis500 kbWin2000PreSP2Fix Technology : kbiisSearch kbiis500 kbiis400 Version : winnt:4.0,5.0 Hardware : ALPHA x86 Issue type : kbprb Solution Type : kbfix ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2002.