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

#!/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); }
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.

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

warn ("*****LOGIN ATTEMPT USER INFORMATION Uid: $uid username: $userna +me password: $password ipaddress: $ipaddress");
Maybe you need to email me your error.log so i can debug farther


In reply to Re^3: Sessions Questions by huck
in thread Sessions Questions by tultalk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.