title: Asp Identity CookieAuthenticationOptions ExpireTimeSpan Not Set
body: <p>I am using ASP.NET Identity and have the following in Startup.Auth</p>
  
  <pre><code>app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
              LoginPath = new PathString("/Account/Login"),
              ExpireTimeSpan = TimeSpan.FromDays(30),
              SlidingExpiration = false,
              Provider = new CookieAuthenticationProvider
              {
                 OnValidateIdentity = SecurityStampValidator.OnValidateIdentity&lt;ApplicationUserManager, User, int&gt;(
                      validateInterval: TimeSpan.FromMinutes(5),
                      regenerateIdentityCallback: (manager, user) =&gt;
                          user.GenerateUserIdentityAsync(manager),
                      getUserIdCallback: (id) =&gt; (id.GetUserId&lt;int&gt;()))
              } 
          });
  </code></pre>
  
  <p>I want users to re-login every 30 days, so I am setting the ExpireTimeSpan property to TimeSpan.FromDays(30).  However, when I check the cookie expiration date via Chrome Settings, it is set to two weeks.  According to  <a href="https://stackoverflow.com/questions/20226016/cookieauthenticationoptions-expiretimespan-does-not-work">this stackoverflow question</a>, 14 days is the default. I made sure to delete any existing cookies before I made the change to ExpireTimeSpan as well.</p>
  
  <p>CookieAuthenticationOptions is part of the Microsoft.Owin.Security.Cookies namespace, of which I have version 3.0.0.0 of the dll.</p>
  
  <p>I also tried setting the FromDays value as a decimal, as discussed in <a href="http://forums.asp.net/t/1982279.aspx?MVC5+Application+Cookie+expires+when+session+ends" rel="nofollow noreferrer">this post</a>. That did not work either. </p>
  
  <p>Any advice as to how to resolve this matter would be greatly appreciated.  Thank you.</p>
  
  <p><strong>UPDATE:</strong> I have ASP.NET Identity 2-factor authentication enabled, consisting of a username &amp; password log-in page with a "Remember Me" check box and a phone code verification page with a "Remember Browser" check box.  When I check both of the remember checkboxes, the cookie expiration is set to 14 days even if I set it to 30.  When I check <strong>only</strong> the first remember checkbox (username &amp; password), the cookie expiration is set to the value I specified.    </p>
  
  <p>So it looks like "Remember Browser" overrides the ExpireTimeSpan property value. Unfortunately, I want the "Remember Browser" to expire after 30 days as well. Two weeks is too often to have to re-enter my phone code. As a side note, the reason I ran in to this problem is because I can't get the Remember Browser cookie to last past the browser session without checking <strong>both</strong> remember checkboxes, as described in this stackoverflow question <a href="https://stackoverflow.com/questions/28745143/asp-net-identity-with-2fa-remember-browser-cookie-not-retained-after-session">Asp.Net Identity with 2FA - remember browser cookie not retained after session</a> .  </p>