saberworks has asked for the wisdom of the Perl Monks concerning the following question:
It redirects, but it refuses to set the cookie. I have telnetted in and no cookie header is ever sent.my $url = $cgi->param('url'); my $cookie = $cgi->cookie( -name => 'affiliate_id', -value => $aid, -path => '/', -domain => $ENV{'HTTP_HOST'}, -secure => 0, -expires => '+3d' ); $self->header_add(-cookie => $cookie); $self->header_add(-redirect => $cgi->redirect($url));
but it made no difference, still refused to set the cookie.$self->header_add(-cookie => [$cookie]);
Same thing happens, no luck with the cookie, although it redirects.print $cgi->header( -cookie => $cookie, -redirect => $cgi->redirect($url) );
This seems to be working fine, but I am wondering why all this is so flaky - I should be able to use header_add() right? And I should be able to print directly as well, right?$self->header_type('redirect'); $self->header_props( -url => $url, -cookie => [$cookie] );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Application, cookies, and redirects
by astroboy (Chaplain) on May 23, 2005 at 22:52 UTC | |
|
Re: CGI::Application, cookies, and redirects
by johnnywang (Priest) on May 24, 2005 at 04:32 UTC | |
by saberworks (Curate) on May 24, 2005 at 06:03 UTC |