session_gc: maxlifetime vs probability/divisor
Posted: Sat Jul 24, 2010 3:14 am
maxlifetime vs probability/divisor, which one has higher priority?
For example,
setting: maxlifetime = 1440 (24 minutes)
probability/divisor = 1/100 = 1% : all session data will be erased once per 100 new session.
According to php.net, when user inactive (due to preparing the writing) more than 24 minutes, the session will still persist as long as number of new session not yet reach 100 (probability/divisor).
What if this is a high traffic website, there is already 100 session within 12 minutes? Will all the session been deleted regardless of their maxlifetime? Or will the garbage collector check their maxlifetime and only delete those already expired?
What is the reference point of maxlifetime?
Is the time elapsed counted from the first session_start() statement of the first script called?
Or every scripts called within the same session will reset this timer? If so, what is the criteria? by executing session_start() or changing the session data?
I need to clear about this before I can implement solution to make sure the user session will maintain as long as the user not logout, not closing the browser.
If user inactivity more than maxlifetime(24 minutes), I can poke them with javascript to decide whether to continue the session or not. If no response from them, then the session will expire when maxlifetime reach.
I couldnt find detail explanation on this topic from php.net or else where.
Please kindly help and advice.
Thanks!
Keith
For example,
setting: maxlifetime = 1440 (24 minutes)
probability/divisor = 1/100 = 1% : all session data will be erased once per 100 new session.
According to php.net, when user inactive (due to preparing the writing) more than 24 minutes, the session will still persist as long as number of new session not yet reach 100 (probability/divisor).
What if this is a high traffic website, there is already 100 session within 12 minutes? Will all the session been deleted regardless of their maxlifetime? Or will the garbage collector check their maxlifetime and only delete those already expired?
What is the reference point of maxlifetime?
Is the time elapsed counted from the first session_start() statement of the first script called?
Or every scripts called within the same session will reset this timer? If so, what is the criteria? by executing session_start() or changing the session data?
I need to clear about this before I can implement solution to make sure the user session will maintain as long as the user not logout, not closing the browser.
If user inactivity more than maxlifetime(24 minutes), I can poke them with javascript to decide whether to continue the session or not. If no response from them, then the session will expire when maxlifetime reach.
I couldnt find detail explanation on this topic from php.net or else where.
Please kindly help and advice.
Thanks!
Keith