title: HTTP Session management in Web application (Ajax/Servlet)
body: <p>Currently I have a webpage, with login credentials, which when provided with the appropriate ones, allows the user to login. Now, after this login (where validation is done via ajax call to a Servlet), the user is redirected to a different page (with different URL). How do I create/manage a session ? </p>
  
  <p>I would require the following functionality :</p>
  
  <ol>
  <li>If the user closes the tab/browser window, the user should be made to logout. </li>
  <li>Further if the user generates no activity for a long period of time (about 15 minutes), user should be logged out automatically.</li>
  </ol>
  
  <p>Note : I don't want to rely on cookies. Is there any other way ?</p>
  
  <p>Also do I need to perform repeated polling to the server ? (So that if the server doesn't get requests after a certain period of time, the session is made to expire...)</p>