FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Capture logoff on browser close
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Capture logoff on browser close [message #169747 is a reply to message #169742] Fri, 24 September 2010 15:16 Go to previous messageGo to previous message
MikeB is currently offline  MikeB
Messages: 65
Registered: September 2010
Karma:
Member
"Álvaro G. Vicario" wrote:
> El 24/09/2010 14:50, Bill Braun escribió/wrote:
>> I would like to update a mysql record with a logoff time if the user
>> fails to affirmatively logoff and only closes the browser. My research
>> indicates this is fluky, unreliable, difficult, impossible, or all of
>> the above. Any practices you know of that may improve the chances of
>> capturing such a log off time?

Do you specifically only need to capture when the user closes the
browser (and all cascading events that may force-close the browser - ie.
if the OS crashes, do you need to record a browser close event?) , or do
you alos need to capture events such as the user losing network
connectivity or putting the machine in Sleep/hibernate state and then
perhaps later resuming without opening/closing the browser? :)

>
> You've done very good research so there's not much I can add to that.
>
> If it is such a mission critical piece of info (or there's a manager
> that's willing to make you waste time on it) you could try a difference
> approach. Perhaps you can implement a "ping" feature with JavaScript.
> Write some client-side code that runs at specific internals (perhaps
> once a minute) an performs an HTTP request to the server. Store these
> pings in the database. As soon as they stop coming in, you can assume
> the user closed the browser (or had a network outage or hibernated his
> computer or your script stopped working). On this line, you can capture
> the onbeforeunload event (not sure about the exact name) and send a
> "bye-bye" ping to the server (if you're very lucky, it may even get on
> time to the server).
>
> This method is fluky, unreliable, difficult, impossible or all of the
> above so it may suit your problem :)
>
>


Good points.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Authentication code creation for google analytics API in PHP
Next Topic: APC + Multi-Site Install of Single Application
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 07:53:54 GMT 2024

Total time taken to generate the page: 0.05800 seconds