Page 1 of 1

PHP removing files sessions

Posted: Mon Jan 11, 2016 3:17 pm
by edica
About removing files in the folder sessions? How PHP does this automatically for each site?
I use Ubuntu but here not work.

php.ini:
session.gc_divisor 1000
session.gc_maxlifetime 1440
session.gc_probability 1

Re: PHP removing files sessions

Posted: Tue Jan 12, 2016 8:35 am
by skurudo
I don't really trust php GC anymore (from php 5.4 and later) and clean this mess with my own hands, so you do too with small bash script in cron:

Code: Select all

nice find /home/*/tmp -type f -name 'sess_*' -ctime +5 -delete