title: How to update a session attribute in Spring MVC web app
body: <p>I store a shopping cart instance during the checkout process in a session variable via org.springframework.web.bind.annotation.SessionAttributes:</p>
  
  <pre><code>@SessionAttributes({"shoppingCart"})
  public class CheckoutController { ... }
  </code></pre>
  
  <p>However, when the checkout process is completed I want to store a fresh new ShoppingCart instance in the session.</p>
  
  <p>I need something like:</p>
  
  <pre><code>sessionAttributes.set("shoppingCart", new ShoppingCart());
  </code></pre>
  
  <p>Which method can I use to achieve this task?</p>