title: how to detect that user's connection is lost or he closed the browser window in Nodejs socket.io
body: <p>I have a chat application on Node.js and Socket.io, user can connect and disconnect with a button...
  I am having a list of online users which is perfectly managed with the help of my defined events that user trigger. 
  <br><br>But the problem is I am unable to detect if the user has lost his connection or closed the browser window without disconnecting himself manually(by the disconnect button)...</p>
  
  <p>This socket.io event is fired only when user disconnects himself not when he lost his connection.</p>
  
  <pre><code>socket.on('disconnect',function(){
     console.log('user disconnected');  });
  </code></pre>
  
  <p>I want some really good mechanism to keep an eye on users in order to update my Online users list.</p>