HttpSession.setMaxInactiveInterval在Tomcat 6中不起作用 [英] HttpSession.setMaxInactiveInterval not working in Tomcat 6

查看:1035
本文介绍了HttpSession.setMaxInactiveInterval在Tomcat 6中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用HttpSession.setMaxInactiveInterval调整会话超时,但它无法正常工作。

I'm trying to adjust the session timeout using HttpSession.setMaxInactiveInterval and it's not working.

这是我的代码(Groovy),它正在执行,没有例外:

Here is my code (Groovy), which is executing without exceptions:

def paramValue = WebAttributes.REQUEST.getParameter('maxInactiveSeconds');
println 'paramValue=' + paramValue;
if (paramValue != null) {
  def seconds = Integer.parseInt(paramValue);
  WebAttributes.REQUEST.getSession().setMaxInactiveInterval(seconds);
}

一些细节:


  • Tomcat 6.0.16

  • 这是在一个独立于普通的web应用程序中发生的(即具有可视内容),但我已经定义了emptySessionPath = true所以会话*应该*在webapps之间共享

谢谢,

haruspex

推荐答案

原来还有另一种技术将maxInactiveInterval设置回30分钟,覆盖了我改变它的尝试。

Turns out there was another technology setting the maxInactiveInterval back to 30 min, overriding my attempts to change it.

Tomcat,Java等都按预期工作。

Tomcat, Java, etc. were all working as expected.

这篇关于HttpSession.setMaxInactiveInterval在Tomcat 6中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆