title: ASP.NET Identity Change ExpireTimeSpan after ConfigureAuth
body: <p>I'm working on a web application that I recently migrated from a custom authentication solution to ASP.NET Identity. In some sections of our app, long processes are performed that can take up to an hour to run. Under normal circumstances, we want users to be automatically logged out after 30 minutes of non-activity. However, for screens where long processes occur, we want to widen the automatic logout window so that they don't get kicked out before the process completes. I'm currently struggling with how to accomplish this with Identity. I am currently using the following code in my Startup.Auth.cs file:</p>
  
  <pre><code>public partial class Startup
  {
      // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301883
      public void ConfigureAuth(IAppBuilder app)
      {
          // Configure the user manager and signin manager to use a single instance per request
          app.CreatePerOwinContext&lt;ApplicationUserManager&gt;(ApplicationUserManager.Create);
          app.CreatePerOwinContext&lt;ApplicationSignInManager&gt;(ApplicationSignInManager.Create);
  
          // Enable the application to use a cookie to store information for the signed in user
          // and to use a cookie to temporarily store information about a user logging in with a third party login provider
          // Configure the sign in cookie
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
              LoginPath = new PathString("/Login.aspx"),
              ExpireTimeSpan = TimeSpan.FromMinutes(30),
              SlidingExpiration = true,
              Provider = new CookieAuthenticationProvider
              {
                  OnValidateIdentity =
                      SecurityStampValidator.OnValidateIdentity&lt;ApplicationUserManager, ApplicationUser, int&gt;(
                          TimeSpan.FromMinutes(30),
                          (manager, user) =&gt; user.GenerateUserIdentityAsync(manager),
                          userIdentity =&gt; userIdentity.GetUserId&lt;int&gt;())
              }
          });
      }
  }
  </code></pre>
  
  <p>I currently don't see any way to modify the ExpireTimeSpan value after <code>ConfigureAuth</code> has already been called. I hope to be able to change the value in the <code>Page_Load</code> event handler from a Web Form page. Does anyone know of a way?</p>