php - How it is working gc_maxlifetime -


have session settings:

@ini_set('session.gc_probability', 1); @ini_set('session.gc_divisor', 1); @ini_set('session.gc_maxlifetime', 60);   session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');  function _sess_gc($maxlifetime) {       echo "gc started";   } 

as far understand settings garbage collector should run every 60 seconds (because probability , divisor same). im testing , strange thing gc runs everytime im refreshing website, not waiting until 60 seconds has passed previous call. bit confusing me, understand wrong here?

session.gc_probability / session.gc_divisor = x

in case x = 1. (= 100% chance)

this means garbage collector run on every request. every request makes.

the garbage collector delete sessionfiles stale , eligible deletion, not files modified. considered stale defined session.gc_maxlifetime


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -