On Sun 15 Feb 2009, Roger Munk wrote:
> On Sun, Feb 15, 2009 at 5:12 PM, André Warnier <a...@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.foert...@gmx.net

Reply via email to