java 大于30分钟,如何将会话超时设置为大于30分钟
Dose anybody know how to set session timeout greater than 30 minutes?
these two methods wont work (default to 30 min).
60
and
session.setMaxInactiveInterval(600);
Thanks.
解決方案
Setting session timeout through the deployment descriptor should work - it sets the default session timeout for the web app. Calling session.setMaxInactiveInterval() sets the timeout for the particular session it is called on, and overrides the default. Be aware of the unit difference, too - the deployment descriptor version uses minutes, and session.setMaxInactiveInterval() uses seconds.
So
60
sets the default session timeout to 60 minutes.
And
session.setMaxInactiveInterval(600);
sets the session timeout to 600 seconds - 10 minutes - for the specific session it's called on.
This should work in Tomcat or Glassfish or any other Java web server - it's part of the spec.
總結
以上是生活随笔為你收集整理的java 大于30分钟,如何将会话超时设置为大于30分钟的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java url api_深入阅读jav
- 下一篇: 图像腐蚀 java_OpenCV3 图像