Okay, I have a live application, it runs a messenger and I am trying to find the most reliable way to determine if a user has navigated away from the page or closed the window, et cetera. I have already implemented this:
window.onbeforeunload = function(event){ /* my code */ };
But that isn't always very reliable, sometimes it will fire and sometimes not. Is there a more reliable way of determining user presence or lack thereof?