title: How to logout user after disconnect or browser close?
body: <p>I'm trying to work a solution to timing out a user from my web application. I'm currently using ng2-idle and it seems to only work on the active window rather than be tracked server side (angular server webpack) </p>
  
  <p>I need to handle these two events in addition to the one above:</p>
  
  <ul>
  <li>On Browser Close</li>
  <li>On Connection loss (Power cut, blue screen, etc..)</li>
  </ul>
  
  <p>After testing, my timeout was not being tracked after closing the window. Ng2-idle has modules such as keepalive but I'm not exactly sure how to use it and if it solves my problem</p>
  
  <p>I will provide code if needed</p>
  
  <p>thank you</p>