spring-session sessionDestroyed

Posted rgqancy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring-session sessionDestroyed相关的知识,希望对你有一定的参考价值。

 

    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        logger.trace("会话销毁");

        // 功能实现:将session过期的用户的状态设置为离线
        HttpSession session = httpSessionEvent.getSession();
        String sessionId = session.getId();

        // 注意:不要用sessionOld,必须用session。
        // 1.sessionOld的与session,运行时的实例是不同的。
        // 2.sessionOld的与session,分别调用session.getAttribute("xxx");前者会报错,后者则正常。
        // TODO renguoqiang 未注释如下代码行,是为了方便批量查找相关代码,排除相关隐患。
        HttpSession sessionOld = ContextHolderUtils.getSession(sessionId);

        ClientManager.getInstance().removeClinet(sessionId);

 

 

Spring Session sessionDestroyed - 国际版 Bing
https://cn.bing.com/search?q=Spring+Session+sessionDestroyed&qs=n&form=QBRE&sp=-1&pq=spring+session+sessiondestroyed&sc=0-31&sk=&cvid=FFC078A2045549249C97C208B7B0B12A

使用Spring Session Redis 共享Session 后如何监听Session的sessionDestroyed事件_viaco2love的博客-CSDN博客
https://blog.csdn.net/viaco2love/article/details/79880751

Spring Session
https://docs.spring.io/spring-session/docs/1.3.1.RELEASE/reference/html5/#httpsession-httpsessionlistener

Spring Session
https://docs.spring.io/spring-session/docs/1.3.1.RELEASE/reference/html5/#samples

Spring Session
https://docs.spring.io/spring-session/docs/1.3.1.RELEASE/reference/html5/#httpsession-redis

Spring Session
https://docs.spring.io/spring-session/docs/1.3.1.RELEASE/reference/html5/#samples

Spring Session
https://docs.spring.io/spring-session/docs/1.3.1.RELEASE/reference/html5/#samples

spring-session/samples/httpsession-xml/src/main/webapp/WEB-INF/spring at 1.3.1.RELEASE · spring-projects/spring-session
https://github.com/spring-projects/spring-session/tree/1.3.1.RELEASE/samples/httpsession-xml/src/main/webapp/WEB-INF/spring

spring-session/web.xml at 1.3.1.RELEASE · spring-projects/spring-session
https://github.com/spring-projects/spring-session/blob/1.3.1.RELEASE/samples/httpsession-xml/src/main/webapp/WEB-INF/web.xml

spring-boot通过HttpSessionListener监听器统计在线人数_不变的24号-CSDN博客
https://blog.csdn.net/zhangjq520/article/details/53670966

spring session redis 实现集群session共享,SessionListener监听生效_有理想的coder-CSDN博客
https://blog.csdn.net/huangmingleiluo/article/details/79285511

Spring Boot配置HttpSessionListener和HttpSessionAttributeListener无效。-CSDN论坛
https://bbs.csdn.net/topics/392310390

spring boot之session的创建,销毁,超时,监听等等小结_east123321的博客-CSDN博客
https://blog.csdn.net/east123321/article/details/79157464

Spring Boot 使用session监听器 - 刘勇1993 - 博客园
https://www.cnblogs.com/liuyong1993/p/10012808.html

NullPointerException in sessionDestroyed listener · Issue #499 · spring-projects/spring-session
https://github.com/spring-projects/spring-session/issues/499

spring - HttpSessionListener.sessionDestroyed() method is getting called twice during Session timeout - Stack Overflow
https://stackoverflow.com/questions/38084221/httpsessionlistener-sessiondestroyed-method-is-getting-called-twice-during-ses

以上是关于spring-session sessionDestroyed的主要内容,如果未能解决你的问题,请参考以下文章

使用 Spring-Session 时更新 Session 中的 Principal

初试spring-session

在使用 spring-session 的单元测试中,身份验证不应为空

Spring-session整合到Redis

spring-session sessionDestroyed

Spring-SESSION+Redis 实现Session共享