Hi: Several questions: Code I wrote long ago (2003) commneted out $session->delete() and $session->flush(). in numerous locations where a login fails for any reason. The sessions database contains all those failed session data from failed logins. In the sessions, failed login attempts are counted. If these sessions were deleted and flushed at each failure, how would attempts be kept track of? I am assuming it is through the session. Second: In the login function I am trying to set the expiration for 7 days in the future. Code below does not work. Several earlier place in the routine set different (short) expirations but the one below is the final in the login process.

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); # $session->expires('+1d'); Expires($session, Now() + (86400*7)); AccessInOutLog($session); #Added 02/18/05 my $isloggedin = $session->param('isloggedin'); warn("Login User Line 420: SID '$sid' Session Logged In '$isl +oggedin'"); $session->flush(); #Set session cookie on client SetUserSessionCookie('CGISESSID', $sid);

And examining cookie CGISESSID in browser shows expiration now + 1 day (86400) not now + (86400*7). Any thoughts? Best regards Bob Tulloch


In reply to 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.