[thelist] cross-domain cookies in Netscape

Steven Stalzer steve at newmediacreations.com
Mon Sep 25 14:05:18 CDT 2000

I am trying to create a user id cookie which will identify the user whether they
return either to www.townvalues.com or townvalues.com. (These two domains, as
you would expect, simply point to exactly the same IP address.) You would think
this would be simple - when creating the cookie, just specify the domain as
".townvalues.com" and it should be readable for both versions of the domain,
right? Unfortunately, this works fine in Internet Explorer (4.5), but does not
work in Netscape (4.6.1). In Netscape, if you set the cookie using a call to a
simple perl script such as www.townvalues.com/cgi/cgibin/cookieset2.cgi, you can
then easily read it with www.townvalues.com/cgi/cgibin/cookieget2.cgi, but a
call to townvalues.com/cgi/cgibin/cookieget2.cgi (note no "www.") won't fetch

Is there anyway to accomplish this?? Any help appreciated.

Here's a code snippet:


$expDate = "Sunday, 31-Dec-00 12:00:00 GMT";
$path = "/";
$domain = ".townvalues.com";

$cookie_string = "Set-Cookie: townvalues_test=$uid; path=$path;
expires=$expDate; domain=$domain";
print $cookie_string,"\n";

Steven Stalzer, President
New Media Creations, Inc.

More information about the thelist mailing list