develooper Front page | perl.macperl.webcgi | Postings from November 2002

Re: Writing cookies a problem

Thread Previous
From:
henry
Date:
November 15, 2002 23:53
Subject:
Re: Writing cookies a problem
Message ID:
200211151351.AAA00656@gateway.metropolis.net.au
On 20021114 0712, "Mark Wheeler" <musicarr@attbi.com> 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.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About