perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: Alias and PerlOutputFilterHandler in virtual host configuration
Date Sun, 15 Feb 2009 19:10:43 GMT
On Sun 15 Feb 2009, Roger Munk wrote:
> On Sun, Feb 15, 2009 at 5:12 PM, André Warnier <aw@ice-sa.com> wrote:
> > see http://perl.apache.org/docs/2.0/api/APR/Table.html#C_get_
> > (you only get the first one this way)
> > my @cookies = $f->r->headers_out->get("Set-Cookie");
> > would get you an array with both.
>
> Thanks, when I tried receiving the cookies in an array, using the
> code below, I only see the second cookie now in the output. Since
> both cookies are set with seperate "Set-Cookie" headers are they
> getting overwritten at some point, or is there a problem with my
> code?
>
>     unless ($f->ctx)
>     {
>         my @Cookies = $f->r->headers_out->get("Set-Cookie");
>
>         foreach my $Cookie (@Cookies)
>         {
>             $Cookie =~ s/expires.*GMT\;//g;
>             $f->r->headers_out->set("Set-Cookie" => "$Cookie");
>         }
>         $f->ctx(1);
>     }

I am about to say RTFM but being polite: Please read the documentation 
mentioned above more thouroughly. APR::Table provides an "add" method. 
And before you ask your next question "How can I get rid of the 
original cookies?" read that piece again, ;-)

Torsten

-- 
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net

Mime
View raw message