title: IsPersistent not working - Cookie only valid for current session
body: <p>I have an <code>ASP.NET MVC 5</code> application using <code>ASP.NET Identity 2.1.0</code> for user authentication.<br>
  Everything worked fine in the past, but now I found out that persisting user sessions does not work anymore. I can not tell what change broke this, but it worked when I implemented Identity (converted the application from <code>SimpleMembership</code>) and this is my logic I have at the moment:</p>
  
  <pre><code>var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, 
                                       model.RememberMe, shouldLockout: true);
  </code></pre>
  
  <p><code>SignInManager</code> is my <code>ApplicationSignInManager</code> based on <code>SignInManager&lt;ApplicationUser, int&gt;</code> and <code>model.RememberMe</code> is <code>true</code>.  </p>
  
  <p>And my setup:</p>
  
  <pre><code>app.CreatePerOwinContext&lt;ApplicationSignInManager&gt;(ApplicationSignInManager.Create);
  
  app.UseCookieAuthentication(new CookieAuthenticationOptions
      {
          AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
          LoginPath = new PathString("/Account/Login"),
          Provider = new CookieAuthenticationProvider
              {
                  OnValidateIdentity = ApplicationCookieIdentityValidator.OnValidateIdentity(
                      validateInterval: TimeSpan.FromMinutes(0),
                      regenerateIdentity: (manager, user) =&gt; user.GenerateUserIdentityAsync(manager))
              }
      });
  app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
  app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
  app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
  </code></pre>
  
  <p>Everything works fine, except persisting the user sessions. I checked the cookies returned by my server and the <code>.AspNet.ApplicationCookie</code> is allways returned as "valid for current session" instead of some date in the future. So when I close and reopen the browser I need to log in again...</p>
  
  <p><strong>Does anybody have an idea why this is not working (anymore)?</strong></p>
  
  <p>P.S.: I have overriden <code>SignInAsync</code> in my <code>ApplicationSignInManager</code> because I do some custom logic there, but I even checked with the debugger and for the following call:</p>
  
  <pre><code>await base.SignInAsync(user, isPersistent, rememberBrowser);
  </code></pre>
  
  <p><code>isPersistent</code> is <code>true</code>, so it should create a persisten cookie.</p>