Perl Apache Session MySQL inconsistency on Debian Lenny
Hi
I have been tearing my hair out with this. As part of a backend perl script i am holding the Epoch time as session data using apache session and mysql so i can delete sessions after an expiry period. When I retrieve the time it is about three months old even when i only just set it. The code example below best describes the problem: I have got the table set up that Apache session requires. Code:
#!/usr/bin/perl Code:
New session:14199f84b1e646b528d63b3be180a9b1 Anyone got any ideas? |
Ran the same code and works for me. I'm running ubuntu 10.10 You could try add a 'undef %session' right after the first 'untie %session' so that it looks like this:
Quote:
Also are you running the MySQL database and the perl script on the same machine? Have you checked time on local machine...probably so. Michael |
Thanks for your reply. I tried using undef %session but with the same result. The actual script i am using this in is a mod perl script that is called on separate occasions between setting and retrieving the session data (hence the need to use apache session!!). I wrote the script above to see if it was a problem with my main script or mod perl but the phenomenon occurs on this simple perl script also. It always returns a time some time in the afternoon (but different times) on Tuesday the 25th January 2011. How weird is that?
Two of the machines it occurs on (and the one where it works OK) are running Apache::Session 1.86 and the other 1.87 (upgraded to Squeeze). The database is run on the same machine as the script in all cases. I have googled but found no-one who has come across a similar problem. |
It gets even more weird. I started poking around inside Session.pm to see where the inconsistency starts. I added some print commands to give me an idea what the values are as they are processed by apache session and it started working as it should. I narrowed it down to adding a print command in the STORE routine:
Code:
sub STORE { Code:
New session:fa8aa2bc8531313007e0463920fbd25d Code:
New session:92344b19524a01f524bd6afe56bbdec0 |
If you're really sure you've found a bug in Session.pm, you can notify the maintainer; look up the module at search.cpan.org http://search.cpan.org/~rsoliv/Session-0.01/Session.pm.
Also, you may want to raise this at perlmonks.org; where all the Perl gurus hang out. |
I have raised this on perlmonks.org if anyone wants to follow it there.
|
All times are GMT -5. The time now is 05:26 PM. |