Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#! /perl/bin/perl use CGI; $query = new CGI; #print $query->header; #print $query->header(-cookie=>$cookie); #print $query->start_html('My cookie-get.cgi program'); #print $query->h3('The cookie is ...'); #Check if cookie is true else, creating a cookie... $theCookie = $query->cookie('aa_exit'); if(!$theCookie){ $exit_link = "$ENV{'QUERY_STRING'}"; $cookie = $query->cookie(-name=>'aa_exit', -value=>$exit_link, -expires=>'+4h', -path=>'/'); print $query->header(-cookie=>$cookie); print $query->h3('The cookie NOW is ...'); $theCookie = $query->cookie('aa_exit'); print "<BLOCKQUOTE>^^^^^\n"; print $theCookie; print "^^^^^</BLOCKQUOTE><br>\n"; }else{ print $query->header; print "<BLOCKQUOTE>*****\n"; print $theCookie; print "*****</BLOCKQUOTE>\n"; } print $query->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cookie Problem
by mda2 (Hermit) on Jun 10, 2005 at 16:17 UTC | |
|
Re: Cookie Problem
by omega_monk (Scribe) on Jun 10, 2005 at 16:00 UTC | |
|
Re: Cookie Problem
by Elijah (Hermit) on Jun 10, 2005 at 16:19 UTC |