Hi Everyone, I was wondering if there is any way to excecute a script or function when a session has expired, even if the browser was closed.
Thank you in advance I hope someone can help me on this
session handling issue
Moderator: General Moderators
Re: session handling issue
session expiration can be checked when the session object is accessed.
if the browser is already closed, you need some script running mechanism to check for expired sessions in the session tables or files. it is some kind of watchdog routine. to do that you would need a CRON job with a maintanance script of some sort that will check for the expired sessions.
other application usually cheat and use user acesses as triggers to activate this watchdog routine, which of course has the disadvantage that if no one visits your site for a while, maintenance is simply not carried out. hence a CRON job is the correct way to do it.
depening on your session handling method, you can then check for the expired ones and do something on a regular basis, and this is regardless of wether the browser is alive or not.
it has infact nothing to do with the browser being closed or not.
if the browser is already closed, you need some script running mechanism to check for expired sessions in the session tables or files. it is some kind of watchdog routine. to do that you would need a CRON job with a maintanance script of some sort that will check for the expired sessions.
other application usually cheat and use user acesses as triggers to activate this watchdog routine, which of course has the disadvantage that if no one visits your site for a while, maintenance is simply not carried out. hence a CRON job is the correct way to do it.
depening on your session handling method, you can then check for the expired ones and do something on a regular basis, and this is regardless of wether the browser is alive or not.
it has infact nothing to do with the browser being closed or not.