Generally speaking, there is no way for the server to know if the client
browser has been closed, or even if the client has navigated to another
website.
This is because of the fundamental architecture of the web.
The server waits for an incoming HttpRequest.
The server processes the incoming HttpRequest.
The server sends back an HttpResponse.
The server waits for an incoming HttpRequest. If no incoming HttpRequest
arrives, there's nothing the server can do about it...
There have been various possible solutions suggested, mainly to do with the
<body onload> method, but none is satisfactory...
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.