title: ASP.NET MVC: Session closing and forcing login even with "Remember me"
body: <p>I seem to have an issue in my MVC web application where the user is being timeouted out if they're inactive for a period of time, around 20-30 minutes I would say. After they're timed out, whether they've selected the remember me checkbox or not, they're logged out.</p>
  
  <p>I'm using the authentication service that comes with a new MVC project, FormsAuthenticationService to sign in and set the .ASPAUTH cookie   </p>
  
  <pre><code>public void SignIn(string userName, bool createPersistentCookie)
  {
      if (String.IsNullOrWhiteSpace(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
  
      FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
  }
  </code></pre>
  
  <p>The cookie is set correctly, with a expiry date set in the future. I've also set my web.config up with the following settings:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="~/Account/Login" 
             timeout="2880" 
             slidingExpiration="false" /&gt;
  &lt;/authentication&gt;
  
  &lt;sessionState mode="InProc" cookieless="false" timeout="2881"&gt;&lt;/sessionState&gt;
  </code></pre>
  
  <p>I've also set all the settings I can think of in IIS that might do this including the idle timeout setting on the app pool (which was suspiciously set at 20 minutes) to <code>480 minutes</code>.</p>
  
  <p>Why is my session timing out, causing users to have to login in again? How can I make it so a user is not logged out when their 'remember me' cookie is set?</p>