> 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" <[EMAIL PROTECTED]>
>>A: [EMAIL PROTECTED]
>>Copie à: modperl@perl.apache.org
>>
>>[please cc the modperl@perl.apache.org list on all list response threads]
>>
>>Hi [EMAIL PROTECTED],
>>
>>> 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:
>>http://perl.apache.org/docs/2.0/user/coding/cooking.html#Sending_Cookies_Using_libapreq2
>>
>>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 <[EMAIL PROTECTED]>
>>>>A: [EMAIL PROTECTED]
>>>>Copie à: modperl@perl.apache.org
>>>>Sujet: Re: Modperl2 question
>>>>
>>>>[EMAIL PROTECTED] 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
>>>>> (http://perl.apache.org/docs/2.0/user/porting/), but unfortunatelly,
>>>>> I
>>>>> haven't
>>>>> found solutions to my simple problems.
>>>>>
>>>>> 1. How can I read a cookie from a PerlResponseHandler ?
>>[...]
>>
>>
>
>


-- 
TaperFriendlyMusic.org
Where the music never stops...
http://www.taperfriendlymusic.org

Reply via email to