in reply to Re: Cleaning up sessions created by Apache::Session::File when logging out of a CGI application
in thread Cleaning up sessions created by Apache::Session::File when logging out of a CGI application
Thanks, that did the trick. Well, sort of. My session files are getting cleaned up alright and I am probably going to move to a DB_File interface anyway, but when I delete the session, my lock files aren't being cleaned up as well. I thought I could work around this by adding these lines to the top of my script:
my $l = new Apache::Session::Lock::File; $l->clean('./.lockDir', 20);
Just above the lines:
my $scriptName = $query->self_url; $scriptName =~ s/\?.*//;
The problem is, my page where I do the logout modifies the lock, so no matter what it hasn't timed out when we get to the logout processing code, but when I come back into the script later, there are lock files that are hours old and they don't seem to get cleaned up either. I've read the documentation at http://search.cpan.org/author/JBAKER/Apache-Session-1.54/Session/Lock/File.pm and http://search.cpan.org/author/JBAKER/Apache-Session-1.54/Session/File.pm but I guess I still don't understand how the locking mechanism is supposed to work because I'm obviously using it incorrectly. Should I have an external script, maybe a cron job, that cleans up stale lock files? Figuring out which locks belong to sessions that no longer exist in the session directory wouldn't be hard, but I'd really rather understand the proper usage.
Thanks again.
-J.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Cleaning up sessions created by Apache::Session::File when logging out of a CGI application
by cees (Curate) on Feb 10, 2003 at 15:32 UTC | |
by Joey The Saint (Novice) on Feb 10, 2003 at 19:31 UTC |