Re: [mp2] Apache::Cookie only sets last cookie?

[prev] [thread] [next] [Date index for 2005/02/03]

From: Kurt Hansen
Subject: Re: [mp2] Apache::Cookie only sets last cookie?
Date: 14:32 on 03 Feb 2005
ben syverson wrote:

> I'm new to the list, although I've read so many of its messages I feel 
> like I subscribed weeks ago. :) I'm having some problems getting 
> libapreq2's Apache::Cookie to send out more than one cookie. The same 
> basic code worked fine in mp1, which makes me think I'm doing 
> something improperly. The code in question is contained within a 
> subroutine in a module that gets called from a registry script.
>
> Here's the code:
> $r = shift;
> my $cookie = Apache::Cookie->new($r,
> -name => 'id', -value => $id,
> );
> my $cookie2 = Apache::Cookie->new($r,
> -name => 'chocolate_chip', -value => $chip,
> );
> $cookie->bake;
> $cookie2->bake;
> $r->content_type('text/html');
> $r->print("just the chip comes through");
>
> I'm using Apache 2.0.52, mod_perl-2.0.0-RC4, and 
> libapreq2-2.04_03-dev. Apache is configured down to only what is 
> needed to run mod_perl and libapreq2.
>
> Should I cave and use CGI::Cookie to send these measly two cookies?

I'm using Apache 2.0.52, mp-1.99_17, and libapreq2-2.04_03.

Have you checked the expiration of your cookies? With libapreq2, not 
specifying an expiration date has the expiration set to "now". With 
libapreq1, not specifying an expiration date made it a session cookie. 
So, with libapreq2-2.04_03, you need to specifically set the expires to 
undef to make it a session cookie, e.g. "-expires=>undef".

Could that be your problem?

Take care,

Kurt

[mp2] Apache::Cookie only sets last cookie?
ben syverson 10:55 on 03 Feb 2005

Re: [mp2] Apache::Cookie only sets last cookie?
Kurt Hansen 14:32 on 03 Feb 2005

Re: [mp2] Apache::Cookie only sets last cookie?
ben syverson 20:03 on 03 Feb 2005

Re: [mp2] Apache::Cookie only sets last cookie?
Joe Schaefer 20:25 on 03 Feb 2005

Re: [mp2] Apache::Cookie only sets last cookie?
ben syverson 04:32 on 04 Feb 2005

Generated at 11:21 on 20 Feb 2005 by mariachi v0.52