title: How does Facebook know if someone is online
body: <p>I'm doing a real-time website with Node.js (Express framework) and socket.io, at some point it has to detect if someone is 'online' (which is basically if someone has the webpage opened).</p>
  
  <p>I think Facebook chat is a group example for this. But what's the engineering logic behind it?</p>
  
  <p>Thanks a lot!</p>