Answer the question
In order to leave comments, you need to log in
How to automatically delete session files?
When visiting a site, a large number of empty session files are created and the entire disk space is filled up quite quickly.
The session settings are set at the start of the script for 10 minutes. But the files are not deleted automatically. What should I do to remove them?
ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'] .'/sessions/');
ini_set('session.gc_maxlifetime', 600);
ini_set('session.cookie_lifetime', 600);
Answer the question
In order to leave comments, you need to log in
.htaccess
php_value session.gc_divisor 1
php_value session.gc_probability 2
garbage collector not working most likely either
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question