Connecting Tech Pros Worldwide Help | Site Map

cookie test help needed

Stephanie Stowe
Guest
 
Posts: n/a
#1: Jul 19 '05
Hi. I read in some helpful publication

"If a cookie created by a page on catalog.acme.com sets its path attribute
to "/" and its domain attrinute to "acme.com", that cookie is available to
all web pages on catalog.acme.com or to any other server." (JavaScript The
Definitive Guide" O'Reilly)

This is exactly what I am trying to acheive. So I set about to test it.

I have a test server on my network. I went into my host file and pointed its
IP to stephie.com. I put up a little cookie write and read test on the
server. I ran the code with the machine name in the URL.

<machine name/CookieYesy/default.asp

sets the cookie then redirects to readcookie.asp.

The cookie is successfully written and read. The write code is:

Response.Cookies("MyID") = 123456
'Response.Cookies("MyID").Domain = "stephie.com"
Response.Redirect "readcookie.asp"
note that the line that sets the domain is commented out since I have not
gotten there yet. Just trying to write and read a cookie.

The readcookie.asp is:

<%


dim tst, tstdomain

tst = cstr(Request.Cookies("MyID"))


%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<P>

<%
Response.Write "Cookie is: " & tst & "<BR>"




%>

</P>

</BODY>
</HTML>



When I run this by



http://<machine name>/CookieTest/default.asp

the write and read works great. When I do

http://stephie.com/CookieTest/default.asp

the code is run, the redirect occurs, but either the write or the read is
failing. The asp files are in teh same dir. I cannot see why this would be
happening.

Can anyone help me with Cookies 101? I have not even gotten to the point of
trying to read the cookie from the other machine I am going to set up on
plonk.stephie.com!

Thanks!!

S



Stephanie Stowe
Guest
 
Posts: n/a
#2: Jul 19 '05

re: cookie test help needed


I am seeing the readcookie.asp page and

The cookie is

with no value.

Thanks

S
"Brad Simon" <anonymous@discussions.microsoft.com> wrote in message
news:B9C12470-9DEF-4954-92D9-C8BE216E75BE@microsoft.com...[color=blue]
> Could you be a little more specific on this:
>
> When I do
>
> http://stephie.com/CookieTest/default.asp
>
> the code is run, the redirect occurs, but either the write or the read is
> failing. The asp files are in teh same dir. I cannot see why this would be
> happening.
>
> What are you seeing? What aren't you seeing?[/color]


Stephanie Stowe
Guest
 
Posts: n/a
#3: Jul 19 '05

re: cookie test help needed


Um. Er.

Thanks for your willingness to help.

It works fine when I prevent caching so that I am not seeing a previous
instance of running the read without having first executing the write.

Sorry for wasting your time.

S
"Stephanie Stowe" <stowe@whackthisvsac.org> wrote in message
news:uGtjOktBEHA.1140@TK2MSFTNGP10.phx.gbl...[color=blue]
> I am seeing the readcookie.asp page and
>
> The cookie is
>
> with no value.
>
> Thanks
>
> S
> "Brad Simon" <anonymous@discussions.microsoft.com> wrote in message
> news:B9C12470-9DEF-4954-92D9-C8BE216E75BE@microsoft.com...[color=green]
> > Could you be a little more specific on this:
> >
> > When I do
> >
> > http://stephie.com/CookieTest/default.asp
> >
> > the code is run, the redirect occurs, but either the write or the read[/color][/color]
is[color=blue][color=green]
> > failing. The asp files are in teh same dir. I cannot see why this would[/color][/color]
be[color=blue][color=green]
> > happening.
> >
> > What are you seeing? What aren't you seeing?[/color]
>
>[/color]


Brad Simon
Guest
 
Posts: n/a
#4: Jul 19 '05

re: cookie test help needed


Ok, that helps out

A couple more questions. When you go to your cookies directory, do you see the both of the cookies? You may need to search for '@stephie.com' and '@localhost', and look inside the cookies to see if they look alike

If the cookies are there, you will want to put in a little code on the default.asp page, something like
response.write err.number & "<BR>Source: " & err.source & "<BR>Description: " & err.Description
response.en

put this in before your redirect. The page will not redirect, but you will have any error that may be occuring. If there is no error, then put that same code into the redirect page, and take it out of default.asp. See if that gives you any more information

Brad
Closed Thread