> > One possibility: Check the -path option. It's supposed to set it to '/'
> > by default if you dont specify it, but it doesn't. I discovered this
> > about 20 minutes ago with a similar bug. So manually specify something
> > like:
> > my $cookie = Apache::Cookie->new($r,
> >                         -name => 'cookiename',
> >                         -value => 'someval',
> >                         -expires => '+7d',
> >                         -domain => '.dontvisitus.org',
> >                         -path => '/',
> >                         );

what I have is this:

sub set_auth_cookie {
        my $state = shift;

        my $val = build_auth_string($state);
        my $c = Apache::Cookie->new($state->{r},
                -name           => 'ttms_user',
                -value          => $val,
                -expires        => time + 86400*30*7,
                -domain         => $Cookie_Domain,
                -path           => '/',
        );
        $state->{cookie_out} = $c;
}

This is called by various other routines, and $state is a hash = {r => $r, q =
\%q }, where q is a hash = {$r->args, $r->content}.

build_auth_string is another subroutine that makes a 446bit encryption string
thats encoded with mime::base64...

I got a path.  Does that get sent to all webpages ever, or just ones underh te
/ directory?  In otherwords, does hte cookie get sent when accessing
/login.html and not when accessing /admin/view_techs.html?

All the pages on this domain are generated dynamically with a custom built
dispatch table and some awesome subroutinage.  Does that matter?  Maybe I
should read the complete netscape cookie specification :/

I know the cookie is set because it tells me when it expires and when it was
last accessed and what not on the box I browse to it with. (win2k... blah)

And the program itself is running in a Linux environment :)

Time for more warnage in the routines...

If anyone wants sourcecode to look at, email me.  It's much to big to just
post to the list.

Dennis

Reply via email to