title: handle browser refresh socket.io
body: <p>I have a requirement using node js that handles disconnecting a user from a chat application. </p>
  
  <p>I am not sure how to handle telling the difference between a browser closing and a user refreshing the browser.</p>
  
  <pre><code>client.on('disconnect', function () {
          console.log( 'Disconnected' );
          // run mysql code to remove user from logged in table
  });
  </code></pre>
  
  <p>I have googled for a couple hours and cannot find a solution. </p>
  
  <p>This seems like something pretty simple and I think it is the keywords that I am using.</p>
  
  <p>Can someone point me in the right direction on how to handle this?</p>
  
  <p>Thanks in advance. </p>