Re: URGENT: Strange Cookie Problem! Production App is Failing!
If you are accessing the same machine over 2 IP addresses, then I assume
that you are using 2 different names, correct?
Let's say your 2 IP's are named www1.domain.com and www2.domain.com
If you access the "backdoor" IP (www1.domain.com) to get the cookie you get
a cookie for www1.domain.com
When you then access the front door (www2.domain.com) the cookie from
www1.domain.com doesn't apply to this site.
When you write cookies, by default they are host based cookies, and only
apply to the full domain. (www1.domain.com and www2.domain.com).
If you are not using names for the IP's, then you are in just as much
trouble as the cookies will only apply to the IP address.
Read more about cookies in the Cookie RFC (too lazy to find a link for you
right now).
You can change this by making the cookies domain based. Example code:
response.cookies("TEST") = HELLO
response.cookies("TEST").domain = "domain.com"
This code will only work if you are using names, and not IP's to access the
site. Also, the domain.com has to be the domain that the user is comming in
as.
Hope this helps
Steve
"Tony Archer" <me@_N05PAM_tonyarcher.com> wrote in message
news:e#q$7sCuDHA.1760@TK2MSFTNGP10.phx.gbl...[color=blue]
> (Forgive the dupicate post, I had left out the OS Version out of the prior
> post.)
>
> Gentlemen, your urgent help is needed in solving a STRANGE problem.
>
> I have two servers a dev box, and a production box. On the dev box
> everything works fine, in production it hoses:
>
> One of the things a user can do is click a "Change region" link which[/color]
takes[color=blue]
> them to a map of the world. They can then select one of four regions.
>
> When they select a region it takes them to a page which reads a variable[/color]
and[color=blue]
> then sets a cookie which is then referenced throughout the site.
>
> like: cds.asp?r=0 (0,1,2,3 are the valid valies)
>
> NOW I'm not asking you to debug code, as I am POSITIVE it has nothing to[/color]
do[color=blue]
> with that and here's why:
>
> DEV BOX Running NT-4 SP6a:
> - Default FTP (All IPs)
> - Default SMTP (All IPs)
> - Default NNTP (All IPs)
> - Default Web Server (IP-1:80)
> - New Web Server (IP-2:80)
> - New Web Server - Back Door (IP-1:88)
> * IP-1 and IP-2 are assigned to the same network card, there is no second
> NIC.
>
> All three web servers are pointing at the same physical directory. (The
> reason is irrelevant, but if you must know it's because we're using a
> security ISAPI filter which screws up Front Page Extensions. SO the[/color]
second[color=blue]
> IP allows FP to connect and the back door allows a script to run)
>
> If I hit the Default Web Server the cookies are updated and everything
> changes fine.
> If I hit "New Web Server - Back Door" or "New Web Server" the cookie[/color]
appears[color=blue]
> to get updated on the page doing the work (I checked by printing both the
> variable and the request.cookie) but then is not for any other pages
> referencing it.
>
> My Production server is set up in much the same way.
>
>
>[/color] |