Microsoft KB Archive/265372

= Duplicate ASP Collection Key Name with Different Cases Across the Collections Not Advised =

Article ID: 265372

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0
 * Microsoft Internet Information Services 6.0

-



This article was previously published under Q265372



SYMPTOMS
The key names of the Active Server Pages (ASP) collections - ClientCertificate, Cookie, Form, and QueryString - are not case-sensitive. &quot;MyVar&quot; and &quot;myvar&quot; would reference the same collection.

You should avoid using the same name with different cases for different ASP collections. For example, don't use &quot;MyVar&quot; for a cookie name and &quot;myvar&quot; 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.



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 &quot;cookie:SecondValue&quot; should be returned, &quot;cookie:firstValue&quot; is returned instead. Page1.asp <% Response.Cookies(&quot;CookieName&quot;) = &quot;firstValue&quot; %>         Page2.asp <% myvar = Request.Form(&quot;CookieName&quot;) Response.Cookies(&quot;CookieName&quot;) = &quot;Secondvalue&quot; %> cookie: page3.asp Page3.asp <% Response.Write &quot;cookie:&quot; & Request.Cookies(&quot;CookieName&quot;) & &quot;&quot; Response.Write &quot;HTTP_COOKIE: &quot; & Request.ServerVariables(&quot;HTTP_COOKIE&quot;) & &quot;&quot; %>

Keywords: kbfix kbwin2000presp2fix kbprb KB265372

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.