title: ASP.NET Session timing out early
body: <p>I have seen the other questions like me, but they aren't exactly like mine. I am using the standard ASP.NET authentication via the following entry in the web.config file:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms name=".ASPXAUTH" loginUrl="login.aspx" timeout="3600" /&gt;
  &lt;/authentication&gt;
  </code></pre>
  
  <p>login.aspx.cs </p>
  
  <pre><code>accountID = myReader["AccountID"].ToString();
  Session["AccountID"] = accountID;
  </code></pre>
  
  <p>I tested this with the value of 1 and 5 and it worked like it should. Set it to 3600 and left for a half hour, and it expired and redirected me to login when I reloaded the page. I read about the IIS session state settings. I disabled those before I tried 1 min and 5 min and it seemed to work. Just doesn't work for a long interval. Originally IIS was set to in process, and mode was use cookies and timeout was 20 min. Changed it to 3600 to match web.config and it timed out too early. Disabled it and it works for short intervals, seemingly somewhere less than 30 min.</p>
  
  <p>When I change these settings in IIS, do I need to do an IIS reset? So is this setting still at 20 min when I think it's disabled? That almost seems like that is how it is behaving.</p>