title: Troubleshooting session-scoped bean with aop:scoped-proxy
body: <p>In my Spring 3 project I have the following bean definition</p>
  
  <pre><code>&lt;bean name="account" class="sample.model.Account" scope="session"&gt;
      &lt;aop:scoped-proxy proxy-target-class="true" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>CGLib 2.2 is on the class path, so according to the Spring documentation the account bean should be scoped to the http session of a client.</p>
  
  <p>I populate the account bean when a user logs in, if no user is logged in the account bean is null. However, when using two browsers simultaneously to simulate two different http sessions and logging in on the one browser the other browser is also logged in. I interpret this behavior as the account bean not being scoped to the session</p>
  
  <p>Any suggestions on this? Is there a way to check if a CGLib proxy has been created? When I debug the application and inspect the type of the injected account bean at runtime its <code>sample.model.Account</code>. I am not absolutely sure if this finally means that there was no CGLib proxying the cass.</p>