Hi: I'd love to have you explain what you think is in %query It is used all over and contains the parameters (pairs) of the request. "Sets expiration date relative to atime(). so Now() + (86400*7) was real huge considering now is something close to 1488409938." Indeed. Tried with Now() + 7d and it did not work. There is a skunk in the woodpile somewhere. Please bear with me, I have not "really" revisited this code for 12-13 years.

#--------------------------------------------------------------------- +---------- # Log File Functions #--------------------------------------------------------------------- +---------- # FUNCTION: AccessInOutLog($username, $forename, $lastname, $timein,$i +paddress,$timeout); # DESCRIPTION: Enters user information in log file #--------------------------------------------------------------------- +---------- sub AccessInOutLog { use Time::localtime; my $username = $session->param('username'); my $forename = $session->param('forename'); my $lastname = $session->param('lastname'); my $timein = $session->param('timein'); #my $ipaddress = $session->remote_addr(); my $timeout = $session->param('timeout'); warn("AccessInOutLog line 688: $username $forename $lastname $t +imein $ipaddress $timeout"); #--------------------------------------------------------------------- +---------- # Format the log in time my $tm = localtime($timein); my $intimestamp = sprintf("Log In: %4d-%02d-%02d %02d:%02d:%02d" +,$tm->year + 1900,$tm->mon + 1,$tm->mday,$tm->hour,$tm->min,$tm->sec) +; warn "$timein,$intimestamp"; #--------------------------------------------------------------------- +---------- # Format the log out time $tm = localtime($timeout); my $outimestamp = sprintf("Log Out: %4d-%02d-%02d %02d:%02d:%02d +",$tm->year + 1900,$tm->mon + 1,$tm->mday,$tm->hour,$tm->min,$tm->sec +); warn "$timeout,$outimestamp"; #--------------------------------------------------------------------- +---------- # Open the log file and append the entries open(ACCESSLOG, "+>>$admin_log_file") or LogErrorMessage("Unable +to open log file $admin_log_file\n"); print ACCESSLOG $intimestamp . " " . $outimestamp . " Username = + " . $username . " Name = " . $forename . " " . $lastname . " IP Ad +dress = " . $ipaddress . "\n"; close(ACCESSLOG); }

Example from log: Log In: 2017-02-26 11:32:16 Log Out: 1969-12-31 18:00:00 Username = admin Name = Admin Access IP Address = 72.168.129.123 Log In: 2017-02-26 15:55:14 Log Out: 1969-12-31 18:00:00 Username = admin Name = Admin Access IP Address = 72.168.129.123 Log In: 2017-02-26 18:06:59 Log Out: 1969-12-31 18:00:00 Username = admin Name = Admin Access IP Address = 72.168.129.123 Log In: 2017-02-26 18:10:31 Log Out: 1969-12-31 18:00:00 Username = admin Name = Admin Access IP Address = 72.168.129.123 Log In: 2017-02-26 19:08:26 Log Out: 1969-12-31 18:00:00 Username = admin Name = Admin Access IP Address = 72.168.129.123 Log In: 2017-02-27 23:47:36 Log Out: 1969-12-31 18:00:00 Username = admin Name = Admin Access IP Address = 72.168.129.123


In reply to Re^4: Sessions Questions by tultalk
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.