TWBit
asked on
request.ServerVariables("HTTP_COOKIE") weird problem
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("H TTP_COOKIE ") is returning two separate cookie names, obviously causing me problems.
Instead of returning just ASPSESSIONIDCSAADRAA=DKPHN FLAEDGJCHB DJLGGOAKD
it returns
ASPSESSIONIDCSAADRAA=DKPHN FLAEDGJCHB DJLGGOAKD; ASPSESSIONIDCSCBDRAA=GHDPH AJBKGJNFKO JJCNFFNKMS ELECT
and YES, that semicolon is part of the string.
In my code, this is all i am doing:
tmpTable1 = request.ServerVariables("H TTP_COOKIE ")
and then i use tmpTable1 throughout the page.
Finest wines and cheeses to anyone who solves this!
Anyways, here is a problem I am facing as such:
In my asp page, request.ServerVariables("H
Instead of returning just ASPSESSIONIDCSAADRAA=DKPHN
it returns
ASPSESSIONIDCSAADRAA=DKPHN
and YES, that semicolon is part of the string.
In my code, this is all i am doing:
tmpTable1 = request.ServerVariables("H
and then i use tmpTable1 throughout the page.
Finest wines and cheeses to anyone who solves this!
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yup, thats the ticket. Thanks!
tmpStr = request.ServerVariables("H
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)