How can I track the reason why an ASP.NET Session times out?
<p>I'm trying to track down an issue on an ASP.NET v3.5 application where the <code>HttpSession</code> times out before its (default) 20 minutes. We're seeing behaviour where the session is lost only a few minutes into a session, at random and with no discernible cause such as unhandled exceptions. As far as I can tell, the ASP.NET worker process is not dying, otherwise that would have explained the dropped session.</p>

<p>What approach should I use to monitor when the session is dropped? Is there some event I can listen to, or some other hook in the <code>System.Web</code> namespace?</p>

<p>Also, can someone confirm that the countdown to expiration is reset by web activity? That is, the session's lifetime gets reset to the (default) 20 minutes each time the web client makes an HTTP GET or POST?</p>
