Prev: result set in php pagination
Next: Random pick
From: listread on 25 Jan 2010 13:48 Has anyone considered a way to run a script or automatically access a php page when a user leaves a site without logging off? The idea is to gracefully end that user's session. Thanks!
From: Bastien Koert on 25 Jan 2010 13:51 On Mon, Jan 25, 2010 at 1:48 PM, listread <listread(a)cze.com> wrote: > Has anyone considered a way to run a script or automatically access a php > page when a user leaves a site without logging off? > > The idea is to gracefully end that user's session. > > Thanks! > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > You can try using an ajax call paired with the js onunload function to call the server. The other option is to time the user out via cron on the server after x number of minutes -- Bastien Cat, the other other white meat
From: Bruno Fajardo on 25 Jan 2010 14:24 2010/1/25 listread <listread(a)cze.com>: > Has anyone considered a way to run a script or automatically access a php > page when a user leaves a site without logging off? > > The idea is to gracefully end that user's session. The built-in garbage collector is not sufficient for your app? Additionally, you can configure PHP to destroy the session as soon as the client closes your page. > > Thanks! > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
From: listread on 25 Jan 2010 17:04 js onunload sounds like a viable option. Will it work if the use just closes his browser? Thanks for the tip! - Ron On 1/25/2010 12:51 PM, Bastien Koert wrote: > On Mon, Jan 25, 2010 at 1:48 PM, listread<listread(a)cze.com> wrote: > >> Has anyone considered a way to run a script or automatically access a php >> page when a user leaves a site without logging off? >> >> The idea is to gracefully end that user's session. >> >> Thanks! >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> > > You can try using an ajax call paired with the js onunload function to > call the server. The other option is to time the user out via cron on > the server after x number of minutes > >
From: listread on 25 Jan 2010 17:12
Bruno, Thanks for the heads up on the php configuration. I'll check that out. We also need to write some data to a database, things like logout time. That means running a script for some other php code. Thanks! - Ron On 1/25/2010 1:24 PM, Bruno Fajardo wrote: > 2010/1/25 listread<listread(a)cze.com>: > >> Has anyone considered a way to run a script or automatically access a php >> page when a user leaves a site without logging off? >> >> The idea is to gracefully end that user's session. >> > The built-in garbage collector is not sufficient for your app? > Additionally, you can configure PHP to destroy the session as soon as > the client closes your page. > > >> Thanks! >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > |