in reply to Suggestions on cleaning up session files
if (int(rand 5) == 1) {
$self->log->info('Purging old sessions from the DB');
CGI::Session->find('driver:sybase', sub { }, {
TableName => 'sessions',
Handle => My::DB::Module::get_handle()
});
}
Obviously tweak the number after rand to change the probability of running this code based on the popularity of your site. This keeps me from having to schedule yet another cron job to keep old sessions out of the DB.
UPDATE: Just noticed you were referring to file-based sessions.. Haven't tried this approach there..
|
|---|