in reply to Re: A rotten cookie
in thread A rotten cookie
I got confused when you assigned $cookie_to_send to the cookie but printed to header the cookie instead of $cookie_to_send so I tried using both variations; neither errored and neither stored anything in the cookie. Any ideas why?
Thanks so much!
my $code = param('name'); my $cookie = cookie(-name=>'test') || ''; if ($cookie) { } elsif ($code) { my $cookie_to_send = cookie(-name=>'test' -value=>"$code", -expiration=>'+1h'); # print out header print header(-cookie=>$cookie_to_send); print "You had a cookie!<br>"; print "Code: $code<br>"; print "Cookie: $cookie"; } else { print header, start_html; print "You have no cookie"; print start_form( -action => '' ), table( Tr( td("Name:"), td( textfield( -name => 'name', -size => '15 +' ) ) ), Tr( td("Email:"), td( textfield( -name => 'email', -size => '15 +' ) ) ), Tr( td( submit('send') ), ), end_form, ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: A rotten cookie
by thraxil (Prior) on Aug 05, 2003 at 15:59 UTC |