title: How to detect the end of a user's session on website to delete session token
body: <p>For user's who do not want to be remembered between sessions on my site I generate a temporary session token and send it as a cookie to the client so they are remembered between webpages on my site.</p>
  
  <p>The cookie automatically expires at the end of the session since that is the default, but how can I detect the end of the session server side?</p>
  
  <p>I want to delete the session token at the end of the user's session from my database and then should they log in again I want to generate a new session token.</p>