perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred Moyer" <>
Subject Re: Re: Re: Modperl2 question
Date Fri, 10 Mar 2006 17:30:19 GMT
> Hi Fred!
> I'm generating the cookie with CGI::Cookie().
> I think the problem is elsewhere.
> From a PerlResponseHandler, the method I described works,
> but I got the problem within a PerlAccessHandler.
> Should I delegate the cookie generation to the PerlResponseHandler?

I do my cookie handling in the PerlAuthHandler, I don't know off the top
of my head if there are any gotchas with sending cookies from a
PerlAccessHandler but I would guess no.

You may want to use Firefox and the LiveHTTPHeaders plugin to see if the
cookie is reaching your browser.  And dump the cookie to $r->log->debug to
make sure that the values are set correctly.

Take a close look at those cooking recipes.  They use CGI::Cookie so you
should be able to do exactly what they are doing.

> Younes
> ----Message d'origine----
>>Date: Fri, 10 Mar 2006 09:04:58 -0800 (PST)
>>Sujet: Re: Re: Modperl2 question
>>De: "Fred Moyer" <>
>>Copie à:
>>[please cc the list on all list response threads]
>>> Hi Fred!
>>> I'm wondering if there is a correct way to set a cookie in a
>>> PerlAccessHandler.
>>> I've tried something like:
>>>  $r->headers_out->add('Set-Cookie' => $cookie);
>>> and even:
>>>   $r->err_headers_out->add('Set-Cookie' => $cooki
>>> whithout success.
>>> I need to add the cookie if doesn't exists and leave in the request  if
>>> it
>>> exists.
>>There's a few recipes here:
>>How are you generating $cookie?  You'll likely want to add the cookie in
>>any case, to update certain values or timestamps, I can't think of a case
>>where I haven't done so.  You may want to look at Apache2::AuthCookie
>>which is a fully functional module to do exactly this.
>>> Any idea?
>>> Younes
>>> ----Message d'origine----
>>>>Date: Thu, 09 Mar 2006 01:45:40 -0800
>>>>De: Fred Moyer <>
>>>>Copie à:
>>>>Sujet: Re: Modperl2 question
>>>> wrote:
>>>>> Hi All!
>>>>> I'm planing to port a web application for mod_perl1 ro mod_perl2.
>>>>> I've carefully read to porting pages related to that
>>>>> (, but unfortunatelly,
>>>>> I
>>>>> haven't
>>>>> found solutions to my simple problems.
>>>>> 1. How can I read a cookie from a PerlResponseHandler ?

Where the music never stops...

View raw message