in reply to Just Another Question About Sessions And User Management
In the spirit of KISS
use strict; use CGI; my $q = new CGI; # Set a SESSION persistant cookie. (deleted when browser is closed) my $cookie = "name=value;path=\"; print $q->header(-cookie => $cookie); # The cookie value should be some sort of code (encrypted or random), +linked # to a database (or file) variable for validation. # Read a cookie. And don't forget to verify that it's what you expect. my $cookie_value = $q->cookie('name'); if ($cookie_value !~ /^\w{23}$/) { print "not a valid cookie\n" } # Clear a cookie. # Here you can re-write the cookie with a 'past' date, or simply null +it out # Also clear out the database (or file) variable. my $cookie = "name=;path=\"; print $q->header(-cookie => $cookie);
Also take a look a this...
stonehenge
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Just Another Question About Sessions And User Management
by muba (Priest) on Sep 26, 2005 at 02:37 UTC |