Session.gc_divisor

session.gc_probability=1
session.gc_divisor=1
session.gc_maxlifetime=60

With the setting above in the page “php.ini”,
The session will be undefined 1 minute later everytime.

if I change the above like the following, what happens?

session.gc_probability=1
session.gc_divisor=2
session.gc_maxlifetime=60

The difference between session.gc_divisor=1 and session.gc_divisor=2 is, I found, that session.gc_divisor=1 is precise but can be burden to the server, and session.gc_divisor=2 is not precise but can be not burden compared to session.gc_divisor=1.

I like to make it session is active for 3 days, precise, and not burden to the server.
For the purpose of what I like to make, is the code below is correct?

session.gc_probability=0
session.gc_divisor=0
session.gc_maxlifetime=259200

I think that the code above make a session lasts for 3 days.
However I am not sure that session.gc_divisor=0 does make the server to get minimum burdern or not.

It will certainly be the least burden. It will also never clean up sessions, so it isn’t very useful…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.