> -----Original Message-----
> From: Andy Lim [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 01, 2001 5:10 PM
> To: [EMAIL PROTECTED]
> Subject: How to send mutiple cookie entries?
> 
> 
> 
> Hello. I am trying to send mutiple cookie entries($cookie1, $cookie2,
> $cookie3) as you can see from below code.
> 
>       use CGI;
>       my $cookie1 = cookie(-name=>'eid', -value=>$arr[0], 
> -expires=>'1h');
>       my $cookie2 = cookie(-name=>'uname', -value=>$uname, 
> -expires=>'1h');
>       my $cookie3 =
> cookie(-name=>'lg', -value=>'89FHSJu909sadaIO', -expires=>'1h');
> 
>       $HTML::Embperl::http_headers_out{'Set-Cookie'} = $cookie1;
>       $HTML::Embperl::http_headers_out{'Set-Cookie'} = $cookie2;
>       $HTML::Embperl::http_headers_out{'Set-Cookie'} = $cookie3;

http_headers_out is just a hash - you can't have more than
one value in a hash for any given key.

> 
> 
> But it seems like only cookie3 which is the last one, is 
> being sent. Can't I
> call
> "http_headers_out{'Set-Cookie'}" mutiple times? If so, how do 
> I send mutiple
> cookie entries? and retrieve them?

I found the only way to send the same header multiple times
was to do something like this:

$req_rec->headers_out->add('Set_Cookie' => $cookie);

which can be called multiple times and will hopefully do
what you want.

Michael

http://www.iii.co.uk 
Interactive Investor International is a leading UK Internet personal 
finance service that provides individuals with the capability to identify, 
compare, monitor and buy online a number of financial products and
services. 
Interactive Investor Trading Limited, a subsidiary of Interactive Investor 
International plc, is regulated by the SFA.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to