Nomis52 has asked for the wisdom of the Perl Monks concerning the following question:
I'm attempting to set multiple cookies using CGI::Application, this is running under mod_perl.
sub do_login { my $self = shift ; my $q = $self->query ; my $c1 = $q->cookie(-name=>'userID', -value=>'test123', ); my $c2 = $q->cookie(-name=>'sessionID', -value=>'blahblahblah', ); $self->header_type('header'); $self->header_props(-type=>'text/plain', -cookie=> [$c1,$c2], ); }
The problem is that only the last cookie in the array (in this case $c2) gets set. If I swap them to:
$self->header_props(-type=>'text/plain', -cookie=> [$c2,$c1], );
Then only $c1 is set. Finally :
$self->header_props(-type=>'text/plain', -cookie=> [$c2,$c1,$c2], );
Sets only $c2.
header_props() returns a hash with the attributes set. I've checked this and everything _seems_ to be fine. However if I pass this to the header() method from CGI, I get an '', which I think indicates something is wrong:(
The same script under 'traditional' cgi (no mod_perl) works fine
Any help would be much appricated, as I'm sure its something really simple I've missed
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiple Cookies with CGI::Application
by sedhed (Scribe) on Jul 28, 2002 at 03:05 UTC | |
Re: Multiple Cookies with CGI::Application
by Nomis52 (Friar) on Jul 28, 2002 at 03:20 UTC | |
by sedhed (Scribe) on Jul 28, 2002 at 05:00 UTC | |
by Nomis52 (Friar) on Jul 28, 2002 at 05:27 UTC | |
by PodMaster (Abbot) on Jul 28, 2002 at 07:14 UTC | |
by yogivan (Acolyte) on Jul 29, 2002 at 10:07 UTC | |
by Nomis52 (Friar) on Jul 28, 2002 at 07:25 UTC | |
Re: Multiple Cookies with CGI::Application
by acarvalh (Novice) on Jul 28, 2002 at 02:09 UTC | |
by sedhed (Scribe) on Jul 28, 2002 at 03:16 UTC |
Back to
Seekers of Perl Wisdom