title: ASP.NET MVC 5 Identity - How can I keep a user logged in after changing their password?
body: <p>I'm building my first ASP.NET MVC app and I would like the user to remain logged in whenever they change their password and are redirected to the home page.  </p>
  
  <p>I am using SecurityStamp to enable 'Log Off Everywhere' when the user signs in somewhere else.  I have the validateInterval set to 0.  So far this functionality works fine, if I log in using another browser the original session logs out when another request is made.</p>
  
  <p>The issue I am having now is that I would like the user to remain logged in and be redirected to the home screen (not the login page) when they update their password.  <strong>Is it possible to do this?</strong></p>
  
  <p>My change password controller looks like:</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; ChangePassword(ChangePasswordViewModel model)
      {
          if (!ModelState.IsValid)
          {
             return View(model);
          }
           var result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, model.NewPassword);
           if (result.Succeeded)
           {
              var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
                  if (user != null)
                  {
                      await UserManager.UpdateSecurityStampAsync(user.Id);                    
                      await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
                     // go to welcome page
                   }
            }
      }
  </code></pre>
  
  <p>I am confused about the order in which I need to change the password, update the security stamp, and sign the user in.  Do I also need to sign them out before signing them back in?</p>