- 1 decade agoFavorite Answer
Bottom line: It's not possible, except maybe with VBScript. However, if you use that, you must understand that it will only work if the user is running a compatible browser on Windows. If you need to make sure users are logged off, you could try "timing out" their logged in status. i.e., after x number of minutes in which they do nothing, you assume the browser is closed and log them off automatically.
- Charles RLv 41 decade ago
The problem you have is that the browser runs on the client and to detect events on the client you need a client side language. The only alternative that I know of is VB Script but that is not cross-browser compatible and is not supported in other Web Severs like Apache.