CodeIgniter Forums
Session files not being deleted - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Session files not being deleted (/showthread.php?tid=71297)



Session files not being deleted - coolerkid9090 - 07-30-2018

My sessions directory just keeps growing in size until my website runs out of disk space. Why aren't old session files getting deleted? These are my settings, am I doing something wrong? Why isn't PHP garbage collection cleaning these out? Should I do it manually? Thanks

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'mywebsitesession';
$config['sess_expiration'] = (60 * 60); 
$config['sess_save_path'] = FCPATH . "sessions";
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = TRUE;


RE: Session files not being deleted - InsiteFX - 07-30-2018

Did you check your php.ini settings?

Make sure this is not set to 0 - ( session.gc_probability = 1 )
session.gc_divisor = 1000
session.gc_maxlifetime = 1440


RE: Session files not being deleted - coolerkid9090 - 07-30-2018

(07-30-2018, 08:50 AM)InsiteFX Wrote: Did you check your php.ini settings?

Make sure this is not set to 0 - ( session.gc_probability = 1 )
session.gc_divisor = 1000
session.gc_maxlifetime = 1440

I checked and session.gc_probability and session.gc_divisor were both set to 0. We just moved to a new server, so I'm guessing those values got reset because we never used to have this issue. I changed them to what you have. Hopefully, that resolves it. Thanks!


RE: Session files not being deleted - sneakyimp - 09-12-2018

(07-30-2018, 09:11 AM)coolerkid9090 Wrote: I checked and session.gc_probability and session.gc_divisor were both set to 0. We just moved to a new server, so I'm guessing those values got reset because we never used to have this issue. I changed them to what you have. Hopefully, that resolves it. Thanks!
Are you using Ubuntu? I had this same problem. Makes NO sense that the value would be zero. Where do we complain about this?