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