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

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

Thank you.


View Replies:
A3020 replied on at Permalink Reply
Session files are removed automatically by the garbage collector. You can specify after how many seconds files are cleaned up with this setting:
sethhickel replied on at Permalink Reply
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
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());