【问题标题】:Cannot Reset JSESSIONID After Authentication身份验证后无法重置 JSESSIONID
【发布时间】:2018-09-15 13:20:48
【问题描述】:

我正在尝试在登录后重置 JSESSIONID,但我不能。我尝试了以下方法:

...
HttpSession ghostSession = request.getSession(false);
ghostSession.invalidate();
request.getSession(true);

...

// some more manipulations of the ghostSession here. 
...

但是 JSESSIONID 没有被重置。我在这里想念什么吗?是因为在 ghostSession 失效后对其进行的操作会阻止 JSESSIONID 被重置?

顺便说一句,我使用 Resin 4.X 作为我的 Web 容器。

谢谢。

【问题讨论】:

    标签: java refresh reset jsessionid resin


    【解决方案1】:

    感谢here 的见解,这是树脂问题。

    基本上是在做组合

    request.getSession(false).invalidate();
    request.getSession(true);
    

    不会触发 Resin 重置 JSESSIONID。

    另外,HttpSession.changeSessionId() 仅在 Servlet 3.1 之后才受支持,Resin 4.0.X 不支持 Servlet 3.1。

    我最终做的是调整 Resin 的会话处理。 IE。在<session-config> 内将<reuse-session-id> 设置为false。

    我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-09-28
      • 2016-11-16
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-13
      相关资源
      最近更新 更多