M
M
Maxim Tikhonov2016-02-26 18:39:08
PHP
Maxim Tikhonov, 2016-02-26 18:39:08

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

1 answer(s)
D
Dmitry Pechurkin, 2016-02-27
@DPechurkin

.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 question

Ask a Question

731 491 924 answers to any question