CodeIgniter Forums

Full Version: Sessions table not beeing cleared
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I have CI 3, and maybe it's been replaced by now with newer systems(?)

It's working as far as I know.

I looked in the ci_sessions table.

The oldest row has a timestamp corresponding to 8/3/2019, 10:56:56 PM.

I saw in the forum there was a thread about this, but I saw only something about garbage-collecting, which I didn't find in the code-files.

Is this table supposed to be cleared automatically?

I have another question too; can I count how many persons are logged in by using this ci_sessions table.

Greetings Valema
The settings are in the php.ini file.

Code:
; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts on each request.
; Default Value: 1
; Development Value: 1
; Production Value: 1
; http://php.net/session.gc-probability
session.gc_probability=1

; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts on each request.
; For high volume production servers, using a value of 1000 is a more efficient approach.
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
; http://php.net/session.gc-divisor
session.gc_divisor=1000

Make sure that session.gc_probability=1 and not 0 (zero).