Microsoft Knowledge Base Email Alertz

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.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 265372 - Last Review: December 3, 2007 - Revision: 4.2

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

This article was previously published under Q265372

On This Page

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"
%>
<HTML>
<BODY>
<FORM action="page2.asp" method=POST>
<INPUT type=hidden name=someothername value=Hello>
<INPUT type=hidden name=cookiename value=Yes>
<INPUT type="submit" value="Submit">
</BODY>
</HTML>
				
Page2.asp
<%
myvar = Request.Form("CookieName") 
Response.Cookies("CookieName") = "Secondvalue"
%>
cookie: 
<a href=page3.asp>page3.asp</a>
				
Page3.asp
<%
Response.Write "cookie:" & Request.Cookies("CookieName") & "<P>"
Response.Write "HTTP_COOKIE: " & Request.ServerVariables("HTTP_COOKIE") & "<P>" 
%>
				

APPLIES TO
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Services 5.0
  • Microsoft Internet Information Services 6.0
Keywords: 
kbfix kbwin2000presp2fix kbprb KB265372
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate