`
weishuwei
  • 浏览: 328233 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Acegi中Session并发和RememberMe冲突问题解决方法

阅读更多
这个问题着实让我费了好大功夫,本来想放弃Rememberme功能了,后来在邮件列表中发现了解决之道,特此贴出来为大家共享.
 
  1. <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter">  
  2.         <property name="context">  
  3.             <value>org.acegisecurity.context.SecurityContextImpl<!---->value>  
  4.         <!---->property>  
  5.         <property name="forceEagerSessionCreation" value="true"/>  
  6. <!---->bean>  
注意:<property name="forceEagerSessionCreation" value="true"/>这里添加了这个属性,并且设置为true;

邮件列表地址:http://opensource.atlassian.com/projects/spring/browse/SEC-183

贴出原文给大家分享一下:
HttpSessionContextIntegrationFilter now provides an forceEagerSessionCreation property (defaults to false). If set to true, it will cause a HttpSession to be created at the commencement of each web request. When the authentication mechanisms later run, they will use the constructor of WebAuthenticationDetails which does not force a HttpSession to be created, thus extracting a Session ID if the session was already available (either through normal creation operations or the forceEagerSessionCreation property) or leaving the Session ID as null if no HttpSession was available.

The anonymous and remember-me authentication mechanisms have been amended to not force session creation. Those using concurrent session support with either (or both) of these authentication mechanisms will be required to set HttpSessionContextIntegrationFilter.forceEagerSessionCreation = true.

注:在acegi的1.0.3和1.0.4版本中测试通过
分享到:
评论
2 楼 manu82gf 2007-09-19  
RememberMe和Session并发控制能够达到什么样的效果?
1 楼 westlwt 2007-08-02  
什么意思,之前是什么状况?这个有什么用?

相关推荐

    Spring-Security-3应用的11个步骤.docx

    例如,Session一致性验证确保了用户的会话在多个并发请求中的一致性。Remember-Me服务则提供了自动登录功能,使得用户在一段时间内无须重新登录。 2. **方法安全** - 使用AOP(面向切面编程)模式实现安全代理,可以...

    spring security3.0 spring权限问题

    - **14.4 Remember-Me 接口和实现** 如何实现 Remember-Me 功能。 - **14.4.1 TokenBasedRememberMeServices** 基于令牌的 Remember-Me 服务实现。 - **14.4.2 PersistenceStrategy** 用于存储记住我标记的...

    spring security3 中文版本

    - **Remember-Me 认证**:支持“记住我”功能,以便用户无需每次都输入凭证即可访问受保护的资源。 - **添加 HTTP/HTTPS 信道安全**:通过 `&lt;https&gt;` 元素来配置 HTTPS 支持,确保数据传输的安全性。 - **会话管理**...

    shiro权限管理框架.pdf

    10. Remember Me(记住我功能):一次登录后,下次访问无需重新登录。 Shiro的架构从外部来看,API简单易用,具有明确的API契约。从内部来看,它拥有可扩展的架构,便于用户自定义实现。Shiro对外的API核心是...

    springsecurity.pdf

    - **记住我认证**:使用 `&lt;remember-me&gt;` 元素启用记住我功能,以便用户下次访问时无需重新登录。 - **添加 HTTP/HTTPS 通道安全**:使用 `&lt;http&gt;` 元素下的 `&lt;requires-channel&gt;` 子元素来强制某些 URL 使用 HTTPS ...

    Spring Security 3.0.3

    Spring Security 的前身是 Acegi 安全框架,在被 Spring 社区采纳后,经过不断发展和改进,成为了今天广泛使用的 Spring Security。自发布以来,Spring Security 不断进行版本更新,提供了更多的功能和更好的安全性...

    Spring_Security_2.0.x中文参考文档

    - **Remember-Me 认证** - 支持记住用户登录状态的功能,使用户无需频繁输入用户名和密码。 - **添加 HTTP/HTTPS 信道安全** - 可以指定某些资源只能通过 HTTPS 访问,增强数据传输的安全性。 - **同步 Session...

Global site tag (gtag.js) - Google Analytics