Setting to delete /files/tmp or clean up session files

Permalink
I am looking for a setting or .ini file that will clean up the session files that are written to /files/tmp.

Thank you.

Seth

sethhickel
 
A3020 replied on at Permalink Reply
A3020
Session files are removed automatically by the garbage collector. You can specify after how many seconds files are cleaned up with this setting:

http://us1.php.net/manual/en/session.configuration.php#ini.session....
sethhickel replied on at Permalink Reply
sethhickel
So you are suggesting adding to the php5.ini file? Do you have some syntax examples? Is it as simple as adding session.gc_maxlifetime integer to the php5.ini file? Do I also need to set gc_probability and gc_divisor or let them default to 1 and 100 respectively?


Would I need to identify the path since it is files/tmp and not the default php install /tmp?

Is there a need to be concerned with /var/lib/php5/ too?
A3020 replied on at Permalink Reply 1 Attachment
A3020
It's a default setting, so it should already be in your php.ini I guess. If not, just add it (see screenshot).

In the manual it says 'PHP_INI_ALL' so you'd also put it in your .htaccess for example.

The value is in seconds so the default (1440) is 24 minutes. It doesn't mean the session is removed after 24 minutes, but that it could be removed after 24 minutes.

If you want to put your session files in /tmp, which is ok, you'd add the following to /config/site.php:

define('DIR_SESSIONS', sys_get_temp_dir());