[英]Spring session gets overridden
<bean id="userSession" class="com.test.service.beans.UserSession" scope="session">
<aop:scoped-proxy/>
</bean>
public class UserSession {
private User currentUser;
/**
* @return the currentUser
*/
public User getCurrentUser() {
return currentUser;
}
/**
* @param currentUser the currentUser to set
*/
public void setCurrentUser(User currentUser) {
this.currentUser = currentUser;
}
In the code to get the current user in the session - I use 在获取会话中当前用户的代码中-我使用
userFacade.getCurrentUser().getUserType()
Accessing the session variable is no problem. 访问会话变量没有问题。 But when I try open another browser and login with another user id (user B), the session variable for user A gets overridden with User B information 但是,当我尝试打开另一个浏览器并使用另一个用户ID(用户B)登录时,用户A的会话变量将被用户B的信息覆盖。
Which browser? 哪个浏览器? If it is internet explorer, you only get one session across as many windows as you have open. 如果它是Internet Explorer,则只能在打开的多个窗口中进行一个会话。 Can you try using a different type of browser? 您可以尝试使用其他类型的浏览器吗? User A in IE and user B in Firefox for example. 例如,IE中的用户A和Firefox中的用户B。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.