in reply to MySQL Session database record

What does the data look like from a native SELECT statement on the DB directly? More importantly, can you please show the code you're using to extract the data from the DB?

To further, what is "Sessions", and what generates its records? Is it being put in place by another Perl application? If so, which one?

Replies are listed 'Best First'.
Re^2: MySQL Session database record
by tultalk (Monk) on Mar 11, 2017 at 03:31 UTC

    Hi: Select result using lates SID logged on: a_session $D = {'_SESSION_ID' => '1603e837e501ebaaef7ce4635e... Select result using last logged out user: a_session $D = {'_SESSION_ID' => '7032f2c7f5a2c721a483dc75fc...

    The data in both a_session records is partof the SID. A normal select statement. Don't understand this question.

    use strict; use diagnostics -verbose; use warnings; use CGI; #use Carp::Always; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use CGI qw(:standard escapeHTML); use CGI qw/:standard/; use Data::Dumper; use Digest::MD5 qw(md5_hex); use DB_File; # persistent hash database use CGI::Session; use CGI::Cookie;

      the SELECT he mentioned is a native SQL command like

      SELECT a_session FROM sessions WHERE id='7032f2c7f5a2c721a483dc75fc295 +95e';
      If you did that it may show you something like this.
      $D = {'forename' => 'forename','timein' => 1489204868,'_SESSION_ID' => + 'eb62615586d9b8a0f14f0dd3d820bf70','username' => 'username','_SESSIO +N_ETIME' => 604800,'_SESSION_CTIME' => 1489204868,'_SESSION_REMOTE_AD +DR' => '192.168.231.211','lastname' => 'lastname','user_id' => 'uid', +'isloggedin' => 1,'_SESSION_ATIME' => 1489204868,'timeout' => 0,'atte +mpts' => 0};;$D
      I am useing the native file support in CGI:Session, it stores each session record in its own file named cgisess_SID where SID is the contents of the _SESSION_ID key. as i suspected the data is a Dumper like structure of the _DATA keys value.