title: ASP.NET Identity Session Timeout
body: <p>I use ASP.NET Identity .. I want to set session timeout to unlimited or max value. I've tried something but it doesn't effect. Note: I use shared hosting.
  Thank you.</p>
  
  <pre><code>//web.config
  &lt;system.web&gt;
  &lt;customErrors mode="Off" /&gt;
  &lt;httpRuntime targetFramework="4.5" /&gt;
  &lt;authentication mode="Forms" /&gt;
  &lt;sessionState timeout="500000" /&gt;
  &lt;/system.web&gt;
  
  //asp.identiyt config 
  public void ConfigureAuth(IAppBuilder app)
  {
      app.UseCookieAuthentication(new CookieAuthenticationOptions
      {
          AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
          ExpireTimeSpan = TimeSpan.FromDays(365),
          LoginPath = new PathString("/user/login"),
          Provider = new CookieAuthenticationProvider
          {
              OnValidateIdentity = SecurityStampValidator.OnValidateIdentity&lt;ApplicationUserManager, ApplicationUser, int&gt;
                  (
                       validateInterval: TimeSpan.FromDays(365),
                       regenerateIdentityCallback: (manager, user) =&gt; user.GenerateUserIdentityAsync(manager),
                       getUserIdCallback: (id) =&gt; (Int32.Parse(id.GetUserId()))
                  )
          }
      });
  }
  </code></pre>