http://qs321.pair.com?node_id=185744

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