Stephen,

I have encountered this same problem (using 2.05-dev). The 'cheap-hack' workaround currently would be to do something like this:

        my $cookie = Apache2::Cookie->new($r,
                                   -name   => $username,
                                   -value  => $session,
                                   -secure => 1,
                                   -domain => '.my.domain.com');
       $cookie->path("/foo/");
        $cookie->bake($r);


Changing my code to work in that fashion caused the 'domain' problem to go away. I know this is not a real solution, but it will avoid the bug until such time that it is fixed.
Cheers,
Chris

Stephen Quinney wrote:

I'm having a problem with Apache2::Cookie (2.05-dev) and mod_perl2
(1.999.23). No matter what order I specify the parameters in for a new
cookie the path always gets set to the value for the domain. Some
sample code:

my $cookie = Apache2::Cookie->new($r,
                                   -name   => $username,
                                   -value  => $session,
                                   -secure => 1,
                                   -domain => '.my.domain.com',
                                   -path   => '/foo/');

$cookie->bake($r);

The cookie set is: username=lGb0fQSynbzgAwIh85pNgInP; path=.my.domain.com; domain=.my.domain.com; secure,
sometimes instead of this I get:

username=HpoX0huDHnTM8JaEsmZNGIJS; path=domain; domain=.my.domain.com; secure,

Which is even weirder.

Any help as to what I'm doing wrong or workarounds if this is a bug
would be appreciated.

Thanks in advance,

Stephen Quinney



--
Chris Jacobson Online-Rewards.com
2900 Jefferson Ave.
Cincinnati, OH 45219

513-665-9070 x310
http://www.online-rewards.com

Reply via email to