I'd love to have you explain what you think is in %query
I'm going to take pity and assume its use CGI::Session;
http://search.cpan.org/~sherzodr/CGI-Session-3.95/Session.pm
expire($time)
Sets expiration date relative to atime().
so Now() + (86400*7) was real huge considering now is something close to 1488409938.
Seems expire and expires does the same thing
# expires() - alias to expire(). For backward compatibility sub expires { return expire(@_); }
This works just fine for me
Notice the 50% chance of being deleted, and the 50% chance of +1m vs +7d. refresh it a few times to watch it delete-cycle and expire-cycle. I'm Looking at a '_SESSION_ETIME' => 604800, run now, thats 7 days.#!/usr/bin/perl use strict; use warnings; select STDOUT; $| = 1; use CGI; use CGI::Session; use Data::Dumper; use HTML::Entities qw/encode_entities/; my $q = CGI->new; my $tssid = $q->cookie('TSSID'); my $title='huh'; my $cookie=undef; my $delete=0; my @lines; my $session; unless ($tssid){ $session = new CGI::Session(undef, undef, {Directory=>'/tmp'}); $cookie = $q->cookie(TSSID => $session->id ); $title='No session'; push @lines,$title; setup_new($session); } # no ssid else { push @lines,'tssid:'.$tssid; $session = new CGI::Session(undef, $tssid, {Directory=>'/tmp'}); if ($tssid ne $session->id) { $cookie = $q->cookie(TSSID => $session->id ); setup_new($session); $title='Expired Session .. made new one'; push @lines,$title; } else { $delete=5>int(rand(10)); $title='old session'; if ($delete) { $cookie = $q->cookie ( -name => 'TSSID', -value => '', -path => '/', -expires => '-1d' ); push @lines,'deleted'; } # delete } # not expired } # not missing if ($cookie){ print $q->header(-cookie=>$cookie);} else { print $q->header();} print '<head><title>'.$title.'</title></head>'."\n"; print '<body>'."\n"; print '<br>session:'.$session->id."\n"; for my $l (@lines) {print '<br>'.$l."\n"; } print '<pre>'."\n"; local $Data::Dumper::Deepcopy=1; local $Data::Dumper::Purity=1; local $Data::Dumper::Sortkeys=1; local $Data::Dumper::Indent=2; print encode_entities(Dumper($session))."\n"; print '</pre>'."\n"; print '</body>'."\n"; if ($delete){$session->delete();} exit; sub setup_new { my $session=shift; my $expires=5>int(rand(10))?'+1m':'+7d'; # $session->expire('+1m'); $session->expires($expires); # $session->expires('+7d'); my $timein = time(); $session->param('user_id','uid'); $session->param('username','username'); $session->param('forename','forename'); $session->param('lastname', 'lastname'); $session->param('timein', $timein); $session->param('timeout', 0); $session->param('attempts',0); $session->param('isloggedin',1); }
play with that, get it to do what you want them make LoginUser do the same thing
so what does AccessInOutLog($session); #Added 02/18/05 do, are you sure it doesnt change expires?
and i just love
Maybe you need to email me your error.log so i can debug fartherwarn ("*****LOGIN ATTEMPT USER INFORMATION Uid: $uid username: $userna +me password: $password ipaddress: $ipaddress");
In reply to Re^3: Sessions Questions
by huck
in thread Sessions Questions
by tultalk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |