title: SPA: how to know if user's alive
body: <p><strong>I have:</strong> SPA application, which means it can even do offline-processing. It means my app ask server only if it needs some additional info or wants to save something.</p>
  
  <p>I holds user connections in Guava <code>Cache</code> with expired policy. It means I shouldn't worry about session destruction after timeout. </p>
  
  <p><strong>Crucial point:</strong> Each time user do some request I reset timeout to avoid session destruction. When user is inactive during some specified period, Guava Cache just throw his session away.</p>
  
  <p><strong>Problem:</strong> The problem is linked with SPA. With SPA, if user don't send any requests it doesn't mean that he's inactive.</p>
  
  <p><strong>I want:</strong> Automatically close user session an log out him after timeout.</p>
  
  <p><strong>Question:</strong> How can I know if user is active or not in SPA?</p>