Bernhard Graf wrote:
Is there a recommended way to delete old session data from disk?

I'm Catalyst::Plugin::Session::Store::File for the session store,
because it is quite robust. The doc says there is a method
delete_expired_sessions(), but that module doesn't seem to care about
expiry at all, so that method seems quite useless.

Deleting all the expired sessions from within a web hit is a bad idea, as you're going to have to do an arbitrary amount of work, taking an arbitrary amount of time... (There may be several _MILLION_ files to delete in an extreme case).

I'd recommend just crontabbing find /tmp/session_dir -mtime +2 | xargs rm or something similar.. (I'd probably wrap this in a script which is a bit smarter and reports / deals with failure better etc, but you get the idea)..


Searchable archive:
Dev site:

Reply via email to