Re: Writing cookies a problem

[email protected] (henry) Sat, 16 Nov 2002 00:21:25 +1030
Newsgroups perl.macperl.webcgi
Message-ID <[email protected]>
On 20021114 0712, "Mark Wheeler" <[email protected]> wrote:

>I am having a little problem with cookies.
....
>The second way worked even less. On both Mac and PC I think the first 
>cookie was written, and then I got text output of the rest of the perl 
>script to the browser window of the 2nd and 3rd cookies and Location 
>change. Again, I am baffled!
>
>Any help would be much appreciated.

use CGI qw(:standard);

my $cookie1 = cookie(-name=>'foo', -value=>$var1);
my $cookie2 = cookie(-name=>'bar', -value=>$var2);

print header(-cookie=>[$cookie1,$cookie2]);

Henry.