1. 在\conf\web.xml中通过参数指定:
<session-config>
<session-timeout>180</session-timeout>
</session-config>
单位为分钟。
2. 在程序中通过servlet api直接修改:
HttpSession session = request.getSession();
session.setMaxInactiveInterval(180*60);
单位为秒,设置为-1永不过期。
<session-config>
<session-timeout>180</session-timeout>
</session-config>
单位为分钟。
2. 在程序中通过servlet api直接修改:
HttpSession session = request.getSession();
session.setMaxInactiveInterval(180*60);
单位为秒,设置为-1永不过期。