I am working on any application in which i need to detect that whether user close the tab or browser so I can disconnect the user from other user basically its an chat applicati
Why not have the client's periodically 'ping' the server to let it know that they are still there, and if a user misses say 3 pings then it will be marked as logged off?