Re: How to catch an irregular end of an application?
| From: | Tim Streater | Date: | Fri, 26 Aug 2011 08:13:00 +0000 |
| Subject: | Re: How to catch an irregular end of an application? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-314617@lists.php.net to get a copy of this message | ||
On 26 Aug 2011 at 01:33, Andreas <maps.on@gmx.net> wrote:
> what is the best practice to catch an irregular end of an application?
> The browser might crash or the user closes accidently the browser window
> decides to jump away to his favourite bloq without loging out of my
> application.
> Is there some way to let an javascript event trigger some ajax to store
> an exit time into my DB or make it mandatory to at least visit the
> logout.php before someone can surf away?
Use the onbeforeunload event.
--
Cheers -- Tim