title: How to refresh the Security Context after the password change in Spring
body: <p>I have a method that changes the user's password in database, but that's the half of the battle. I also need to renew the session context in which the user data is situated.</p>
  <p>For example:</p>
  <pre><code>Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
  /* ...password changing steps...*/ 
  user.setPassword(newPassword); //set the new password in the database
  /* ...something I need to do to insert the new password into the Security Context... */
  </code></pre>
  <p>So what do I need to write in code to refresh the session information after the password change?</p>