speckled has asked for the wisdom of the Perl Monks concerning the following question:
$s = new CGI::Session( "driver:file", undef, {Directory=>'/tmp/'} ) or + die CGI::Session->errstr; # the user's data $s->param('username',$user); $s->param('userid',$userid); $s->param('name',$name); $s->param('surname',$surname); $s->param('~logged-in',"true"); $ipaddr = $s->param('_SESSION_REMOTE_ADDR'); $hostname = qx#host $ipaddr |awk {'print \$5'}#; # verify the user's access level if($isadmin eq 1) { $s->param('isadmin',"true"); } else { $s->param('isadmin',"false"); $s->param('access',"11"); } # register the last login my $lastlogin = funcs::DB->dbgetuniq("SELECT access FR +OM users_access WHERE userid=\"$userid\" ORDER BY access DESC","acces +s"); $s->param('lastlogin',"$lastlogin"); $s->expire("~logged-in", "30m"); $s->expire('+6h'); # register the user access funcs::DB->dbdo("INSERT INTO users_access VALUES('','$ +userid','$ipaddr','$hostname',NOW())"); print $s->header(-location=>'http://mysite/');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Session login problems
by Anonymous Monk on Feb 27, 2009 at 12:53 UTC | |
|
Re: CGI::Session login problems
by Anonymous Monk on Feb 27, 2009 at 12:46 UTC | |
by wazoox (Prior) on Feb 27, 2009 at 16:00 UTC | |
|
Re: CGI::Session login problems
by Anonymous Monk on Feb 28, 2009 at 02:04 UTC | |
by speckled (Novice) on Mar 02, 2009 at 06:49 UTC |