1. Web. xml
Sets the <session-timeout> element in Web application descriptor XML. This value is measured in minutes and overrides the Timeoutsecs property in Weblogic.xml
<session-config>
<session-timeout>60</session-timeout>
</session-config>
This example indicates that the session will expire in 60 minutes
When <session-timeout> is set to-2, this property value will be used for the timeoutsecs set in Weblogic.xml.
When <session-timeout> is set to-1, the session will never expire, ignoring the Timeoutsecs property value set in Weblogic.xml.
This property value can be set through the console console.
2, Weblogic.xml
Sets the Timeoutsecs property of the <session-descriptor> element for the WebLogic unique deployment descriptor weblogic.xml. This value is measured in seconds
<session-descriptor>
<session-param>
<param-name>TimeoutSecs</param-name>
<param-value>3600</param-value>
</session-param>
</session-descriptor>
The default value is 3600
3, the JSP control
Session.setmaxinactiveinterval (7200);
Session is the default object and can be referenced directly, in seconds s
4, the servlet control
HttpSession session = Request.getsession ();
Session.setmaxinactiveinterval (7200);
Unit seconds S
If you use WebLogic as the application server, setting the session timeout will be selected in the WebLogic console settings. In fact, WebLogic is saving the timeout setting in the Weblogic.xml under Web-inf, in the following format:
<session-descriptor>
<session-param>
<param-name>TimeoutSecs</param-name>
<param-value>7200</param-value>
</session-param>
</session-descriptor>
The value in Param-value is the time-out, in seconds. When this parameter is set, the time-out period is found and must be effective. What is this for?
The original under the Web-inf also has a configuration file, Web. XML, there will also be a set session, the format is as follows:
<session-config>
<session-timeout>30</session-timeout>
</session-config>
The value in Session-timeout is also the time-out, in minutes.
If the time-out is set at the same time in the two files, the Web. XML will prevail.
therefore, in the WebLogic environment, it is best to delete the timeout setting in Web. XML, and keep it unique.
the Session-timeout of Web. XML is set to-1, problem solving;
WebLogic How to set the session timeout period