title: Session Scoped Bean Spring multiple user having same instance
body: <p>I am developing a web application using spring mvc 3.2.3.</p>
  
  <p>I have a session scoped bean described in my dispatcher-servlet.xml as :</p>
  
  <pre><code>&lt;bean id="domainCountBean" class="com.count.beans.CountSelectionBean" scope="session"&gt;
      &lt;aop:scoped-proxy/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Then I want to use it from a controller as:</p>
  
  <pre><code>@Controller
  @RequestMapping("/")
  public class DomainController {
      @Autowired
      CountSelectionBean domainCountBean;  
  </code></pre>
  
  <p>.....</p>
  
  <pre><code>    @RequestMapping(value = "/manual_domain/ajaxSet/", method = RequestMethod.GET)
      public ResponseEntity&lt;String&gt; ajaxSetResetApprovalId(
              HttpServletRequest req, HttpServletResponse res
              ) {
  
  
  
          domainCountBean.getDeselectedIds().put(idStr, appId);
  
  
  
          HttpHeaders responseHeaders = new HttpHeaders();
          responseHeaders.add("Content-Type", "text/html; charset=utf-8");
          return new ResponseEntity&lt;String&gt;(jsonString, responseHeaders, HttpStatus.CREATED);
  
      }
  </code></pre>
  
  <p>When I log into my webapp from browser-A : and use domainCountBean things seems to get stored in the session correctly.</p>
  
  <p>In parallel, if I try to login using different user from browser-B: and use domainCountBean then I get value inserted by the user from browser-A. And it happens vice versa. </p>
  
  <p>I am struggling to keep two different instance for the bean mentioned.
  I would like to if my concept is wrong, or that can fix my problem.</p>
  
  <p>P.S: I can not use sessionAttribute here.</p>