title: The "Logging out" event when a user closes the browser
body: <p>I have a table called Eventlog, this table contains already data about user connection: when the user calls this action for example :</p>
  
  <pre><code>public ActionResult Login(string username, string password)
  {
  
  }
  </code></pre>
  
  <ul>
  <li><p>I test whether the user already exists on database or not</p></li>
  <li><p>If yes, I use <code>Session["user"] = username</code> or
  <code>FormsAuthentication.SetAuthCookie(username, true);</code> to set the user
  session</p></li>
  <li><p>And then I put a record on the Eventlog table : <strong>user X was connected at Y o'clock</strong></p></li>
  </ul>
  
  <p>This works fine, but I want also the information about the user logging out. I can do similar thing to the LogOff Action, I guess it is gonna work fine as well, but the majority of people don't use the logoff button, they only close the browser, how is it possible to implement the user logoff event for this situation when the user closes the browser: <strong>user X has been disconnected at Y o'clock</strong>. The Session_End() does not serve the need in this situation.</p>