[Catalyst] Set-Cookie question

Rob Johnson rob at giant-rock.com
Thu Dec 22 21:57:45 CET 2005


I noticed that when I deployed a catalyst project under
Apache, mod_perl2, my outbound cookies were being
read twice by the browser (it would try to set the exact
same cookie twice).  I tracked it down to this line in
Engine/Apache.pm:

if ( $c->response->header('Set-Cookie') && $c->response->status >= 300 )
{       
    my @values = $c->response->header('Set-Cookie');
    $self->apache->err_headers_out->add( 'Set-Cookie' => $_ ) for @values;
}


This causes redirections to present cookies as follows:

Set-Cookie: blah=blah
Location: /redirection/to/new/page
Set-Cookie: blah=blah

Does anyone have experience with this?  Is apache improperly
sending the normal headers on a 302 page?

Thanks!
rob johnson



More information about the Catalyst mailing list