merlininthewood has asked for the wisdom of the Perl Monks concerning the following question:
I have found a really weird quirk! I am using Apache::Session::MySQL 1.86 (standard Debian Lenny install) in a mod_perl script to store epoch time so sessions can be set to expire. I have found that the time is being returned wrong. I started a discussion on linux questions which has more details. It also occurs when storing most integers. I made a simple script to demonstrate the problem:
#!/usr/bin/perl use strict; use DBI; use Apache::Session::MySQL; my $dbhg = DBI->connect("dbi:mysql:mydatabase","username","secret") or die "Could not open MySQL DataBase - SQL Error: $DBI::errstr\n" +; my %session; tie %session, 'Apache::Session::MySQL', undef, {Handle=>$dbhg, LockHan +dle=>$dbhg}; my $sessid = $session{_session_id}; print "New session:$sessid\n"; $session{'atime'} = 2000; print "Time set: $session{'atime'}\n"; untie %session; undef %session; tie %session, 'Apache::Session::MySQL', $sessid, {Handle=>$dbhg, LockH +andle=>$dbhg}; print "Connected session:$session{_session_id}\n"; my $retievedTime = $session{'atime'}; print "Retrieved time: $retievedTime\n"; untie %session;
And this returns:
New session:3498874a51b85f177eede9a7f584e3b0 Time set: 2000 Connected session:3498874a51b85f177eede9a7f584e3b0 Retrieved time: 1855
Even weirder is that when i print the value inside the STORE routine (to see whats going on in there) in Session.pm it works as it should as can be seen on the linux questions post.
Is this a bug in apache session that i should file? Can anyone work out whats going on?!? Thanks in advance.
Merlin
|
|---|