qadwjoh has asked for the wisdom of the Perl Monks concerning the following question:
But it won't create a cookie on my machine.# load CGI information $cgi = new CGI; # load session (from cookie) or create new one if not found if ($session = new CGI::Session(undef, $cgi, {Directory=>$SESSION_DIR} +)) { # expire after 10 minutes $session->expire('+10m'); # set cookie $cookie = $cgi->cookie(-name => "CGISESSID", -value => $session->id, -expires => '+1h', -secure => 1); print $cgi->header(-cookie=>$cookie); # print opening HTML print $HTML_OPEN; if (defined $session->param('authentication')) { # user is authorised - allow access to site print "Welcome back"; # D ... } else { # authorise user if (&authorise_user) { print "Welcome"; # set user info in session file &log_state($session, 'authentication', 'passed') } else { print "You are not welcome"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI cookie problem
by matija (Priest) on Mar 04, 2004 at 15:18 UTC | |
by qadwjoh (Scribe) on Mar 04, 2004 at 15:32 UTC | |
by qadwjoh (Scribe) on Mar 04, 2004 at 16:05 UTC | |
by little (Curate) on Mar 05, 2004 at 13:04 UTC |