WebLogic How to set the session timeout period

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.