Re: Re: pulling script in interval of second.
| From: | Stuart Dallas | Date: | Tue, 01 Jul 2014 21:49:27 +0000 |
| Subject: | Re: Re: pulling script in interval of second. | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323583@lists.php.net to get a copy of this message | ||
On 1 July 2014 22:26, Christoph Becker <cmbecker69@gmx.de> wrote:
> 'stuart Dallas' wrote:
>
> > On 1 July 2014 21:36, Aziz Saleh <azizsaleh@gmail.com> wrote:
> >
> >> Do the onunload, and add a check in you PHP (store the info in the DB)
> >> that if the user doesn't refresh within 2 seconds (enough time to
> navigate
> >> to a different page on the domain), then mark as out.
> >>
> >
> > That's nasty. There should be Javascript attached to any event that might
> > change the page, that checks where that event is taking the user and is
> > enabling/disabling the onbeforeunload accordingly. PHP should not be
> > involved in that logic in any way.
>
> And what if no beforeunload event is triggered (for instance, because
> the browser is crashing or it simply doesn't implement the event)?
>
The unreliability of using this method has already been pointed out to the
OP in a previous thread.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/