bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl print "Content-type: text/html\n\n"; use strict; use CGI; my $query = new CGI; my $username = int(rand 1000000); my $cookie = $query->cookie('xmsessionID'); #check for cookie if (!$cookie) { print "No cookie<br>"; #for testing purposes goto &login } else { print "Cookie found: $cookie<br>"; #for testing purposes } #-------- write new cookie ----------- my $newcookie = $query->cookie(-name=>'xmsessionID', -value=> $username, -expires=>'+15m'); print $query->header(-cookie=>$newcookie);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not able to set and retrieve cookie
by b10m (Vicar) on Apr 28, 2004 at 20:10 UTC | |
by bradcathey (Prior) on Apr 28, 2004 at 21:09 UTC | |
by Anonymous Monk on Apr 28, 2004 at 23:35 UTC | |
by bradcathey (Prior) on Apr 29, 2004 at 02:16 UTC | |
by eric256 (Parson) on Apr 29, 2004 at 03:25 UTC |