Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Querystring and Cookie problem.

3 views
Skip to first unread message

Eifion

unread,
Oct 22, 2003, 11:04:20 AM10/22/03
to
Hello

I've come across a problem when using cookies and querystrings with
the same name. A page on the site reads in a variable from the
querystring and sets a cookie with the same name to its value, e.g.

strSrc = Request.QueryString("Src")
Response.Cookies("Src") = strSource
Response.Cookies("Src").Expires = Now + (2 * 30)

However, I've noticed that if the "Src" cookie exists and the
capitalization of the variable name in the query string is differenct
from the capitalization of the cookie name (e.g page.asp?SRC=xxx) then
a new cookie gets set with the name matching the captialization of the
QueryString variable. Attempting to read the cookie value back then
returns the original value rather than the last set one. Reading the
cookie value via Request.ServerVariables("HTTP_COOKIE") shows both
values.

Has anyone else encountered this problem and come up with a solution?

Eifion

0 new messages