How is it possible to identify that the browser\'s close button was clicked?
you could setup an ajax call that periodically polls your server every few seconds to every few minutes (depending on your wanted time precision) and track the last hit time server side. not completely accurate (eg. network issues could cause a false positive), but may be an option depending on your requirements.