[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


request.ServerVariables("HTTP_COOKIE") weird problem

Posted on 2004-10-27
Medium Priority
Last Modified: 2008-01-09
Every now and again, as an IT professional, you come across problems that defy all logical explanations, and make you ask yourself - "Is someone f***ing with me?"

Anyways, here is a problem I am facing as such:

In my asp page, request.ServerVariables("HTTP_COOKIE") is returning two separate cookie names, obviously causing me problems.  


it returns

and YES, that semicolon is part of the string.

In my code, this is all i am doing:

tmpTable1 = request.ServerVariables("HTTP_COOKIE")

and then i use tmpTable1 throughout the page.

Finest wines and cheeses to anyone who solves this!
Question by:TWBit
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 12424227
Just split the string on the semicolon.

tmpStr = request.ServerVariables("HTTP_COOKIE")
cookieArray = Split(tmpStr, ";")

You can then loop through the array to check for the one you want (in this case it will be item 1)

tmpTable1 = cookieArray(0)
LVL 11

Author Comment

ID: 12424348
Yeah, I was going to resort to string manipulation if all else fails, but what I would like to know is why its returning 2 cookie values.  Any ideas?
LVL 32

Accepted Solution

Brendt Hess earned 750 total points
ID: 12425251
Althoough it is not covered anywhere extensively, the HTTP_COOKIE value depends entirely on what the *browser* sends back.  This entry indicates to me that the browser PC has two active (or not deleted) session cookies related to the requestor site.

If you are doing this from a test PC, try clearing out all cookies in your browser, and try again.  You should only get one value back.
LVL 11

Author Comment

ID: 12425524
Yup, thats the ticket.  Thanks!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question