in reply to Re: Not able to set and retrieve cookie
in thread Not able to set and retrieve cookie
#!/usr/bin/perl use strict; use CGI; my $query = new CGI; my $username = int(rand 1000000); my $result; my $cookie = $query->cookie('xmsessionID'); #check for cookie if (!$cookie) { $result = "No cookie<br>"; #goto &login; } else { $result = "Cookie found: $cookie<br>"; } #-------- write new cookie ----------- my $newcookie = $query->cookie(-name=>'xmsessionID', -value=> $username, -expires=>'+1m'); print $query->header(-cookie=>$newcookie); print "Content-type: text/html\n\n"; print $result,"<br>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Not able to set and retrieve cookie
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 |