Welcome Guest, Not a member yet? Register   Sign In
Sessions table not beeing cleared
#1

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
Reply
#2

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).
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB