Jump to content

Check if user is online


prophy

Recommended Posts

Could it be made a script that check if a user connection is breaked (for example internet connection is stopped or user is closed the browser). And not only to be displayed error message to the user but this event to be registered by my PHP script.

For now the only idia that i have is a JavaScript event onClose() of the browser but this is not the solution that I want.

I was thinking if there is a method for PHP to listening for an event of breaked connection with the user browser or something similar.

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/68118-check-if-user-is-online/
Share on other sites

Well sessions last for the length of the browser being open. (IE, session.) However, PHP is server side, not client side. It can't tell when the client closes the browser. Javascript IS the way to go there.

 

PS: The word you want is broken, not breaked.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.