Re: Accomodating Netscape-style cookies?

Gisle Aas (gisle@aas.no)
12 Mar 1998 10:47:14 +0100


Kartik Subbarao <subbarao@computer.org> writes:

> Gisle Aas wrote:
> 
> > Kartik Subbarao <subbarao@computer.org> writes:
> >
> >  A domain attribute of "acme.com"
> > > would match host names "anvil.acme.com" as well as
> > > "shipping.crate.acme.com".
> > > ---
> >
> > But hopefully Netscape does not send the cookie to www.pacme.com as
> > well??
> >
> > Can you verify that this does not happen with your patch then I will
> > apply it.
> 
> I can't think of a simple way to simulate this -- any ideas?

I just added entries like this:

127.0.0.1 www.acme.com acme.com
127.0.0.1 www.pacme.com

to my /etc/hosts file and let Netscape connect a simple hand-driven
server like the one included below.  I tested with Netscape 4.03 and
it would not accept:

   Set-Cookie: foo=bar; domain=acme.com

from either acme.com or www.acme.com.  Perhaps newer Mozillas do
require the domain to be prefixed with a dot.

Regards,
Gisle


------------------------------------------------
#!/local/perl/bin/perl
use HTTP::Daemon;

$d = new HTTP::Daemon;
print "Please contact me at: <URL:", $d->url, ">\n";

while ($c = $d->accept) {
    $r = $c->get_request;
    if ($r) {
        print $r->as_string;
        $c->autoflush;
        while (<STDIN>) {
            last if $_ eq ".\n";
            print $c $_;
        }
        print "\nEOF\n";
        $r = undef;
    }
    $c->close;
    $c = undef;
}