ASP.NET Session Expiration
<p>I have an ASP.NET web application that, for whatever reason, when it is deployed on any IIS server, will behave like the pages are cached <em>and</em> it simply never posts back to the server.</p>

<p>For example, navigate to the login page, enter credentials, click the login button, and it's back to the login page you go, with the form fields cleared.  The information is not getting submitted back to the server.  The postback is not executing.  It seems the browser is simply restoring the original page from cache.</p>

<p>I found this <a href="http://erlend.oftedal.no/blog/?blogid=41" rel="nofollow">article</a> that says I need to put something in the ASP.NET session state in order for the session to remain valid.</p>

<blockquote>
  <p>When a user connects to an ASP.NET
  application, a unique session ID will
  be affiliated with the user. If
  nothing is put in the session however,
  no cookie will be sent to the browser.
  This means that the user will get a
  new session ID the next time a new url
  is open or the page is refreshed. If
  something is put on the session
  (HttpContext.Current.Session["Hello] =
  "hello") however, ASP.NET will issue a
  cookie called ASP.NET_SessionId. This
  cookie contains the user's session ID
  and the cookie will expire at the end
  of the session (when you close your
  browser).</p>
</blockquote>

<p>I will try what that article recommends, as I had not been storing anything in the session.</p>

<p>I have also added expiration headers to the page:</p>

<pre><code>Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetNoStore()
</code></pre>

<p>and put some meta tags in the html:</p>

<pre><code>&lt;meta http-equiv="pragma" content="no-cache" /&gt;
&lt;meta http-equiv="cache-control" content="no-cache" /&gt;  
</code></pre>

<p>Any other ideas as to what the cause of this behaviour may be?</p>
