title: Spring RedirectAttributes clears session after redirect
body: <p>In my Spring i have used RedirectAttributes to display the message after login success or failure
  and i have one SessionAttribute. I set SessionAttributes in two  times first one is when i click the menu
  i set Object to SessionAttribute and second one is after login success
  what my problem is the SessionAttribute which i set after login success is not working if i remove the
  RedirectAttributes means it is working fine.</p>
  
  <p>when i searched i found this</p>
  
  <pre><code>addFlashAttribute actually stores the attributes in a flashmap (which is internally maintained in the 
  users session and removed once the next redirected request gets fulfilled)
  </code></pre>
  
  <p>when i debug it alwys shows the default one not show the value set after login.</p>
  
  <p>this is for login</p>
  
  <pre><code> @RequestMapping(value = "/sample-client", method = RequestMethod.POST)
      public String getClient(HttpServletRequest request, Model model, final RedirectAttributes redirectAttributes) {
          String userName = request.getParameter("userName");
          String password = request.getParameter("password");
         Client client = createClient(userName, password);
          if (client != null) {
              model.addAttribute("clientObject", client);
              redirectAttributes.addFlashAttribute("message", "Logined Successfully");
              return "redirect:" + "/sample/user";
          } else {
              redirectAttributes.addFlashAttribute("error", "true");
              return "redirect:" + "/sample/login";
          }
      }
  
  after login 
   @RequestMapping(value = "/byName", method = RequestMethod.GET)
      public
      @ResponseBody
      String getUserByName(HttpServletRequest request, @ModelAttribute("clientObject") User user) {
          String firstName = request.getParameter("firstName");
          String lastName = request.getParameter("lastName");
          Integer page = Integer.parseInt(request.getParameter("page"));
          return sample.getUserSearchByName(user, firstName, lastName, page);
      }
  </code></pre>
  
  <p>when i checked the clientObject here it shows the default one.</p>