Garbage collection |
Hi folks,
For some reason I have the impression that the garbage collection is not working as intended. These settings are used in CodeIgniter: Code: $config['sess_driver'] = 'database'; And these are set according to PHPInfo: Code: Directive Local Value Master Value When I look in the session table, there are over 10.000 rows. How come these are not yet removed by the garbage collection? I'm hoping someone could shed some light on what I am doing wrong. Thanks in advance. Reno
You can edit php.ini an adjust either the session.gc_divisor or session.gc_probability to change the probability that GC will occur. Currently you're set to one chance in 1000 that GC will run when a session is initiated. GC can be time intensive so you don't want to run too often, particularly on a busy site.
If you want you can set up a cron and do your own custom garbage collection based on your session settings. You don't have to rely on the built in GC mechanism. This is one example:
PHP Code: public function ci_sessions_gc() |
Welcome Guest, Not a member yet? Register Sign In |