• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session files not being deleted

#1
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;
Reply

#2
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
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(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!
Reply

#4
(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?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.