JSP-session failure settings

Source: Internet
Author: User

(1) Add:

Httpsession session = request. getsession (true );

Session. setmaxinactiveinterval (900 );
The unit of the parameter 900 is seconds. That is, the session will expire after 15 minutes of no activity.
Note that the time set for this session is calculated based on the server, rather than the client. So if you are debuggingProgramIt should be to modify the server time for testing, not the client.
(2) It is also a common method to set the session expiration time, that is, to set the session expiration time in the project's web. xml.
<Session-config>
<Session-Timeout> 15 </session-Timeout>
</Session-config>
15 or 15 minutes are invalid.
(3) set it directly on the application server. If it is tomcat, you can set it in CONF/Web. xml under the Tomcat directory.
Find the <session-config> element. Tomcat is set to 30 minutes by default. You only need to modify this value.

It should be noted that if all three of the above are set, there is a priority problem, from high to low:
(1 )--? (2 )---? (3)

 

Reference: http://blog.csdn.net/xiaosu_521/article/details/2045757

Related Article

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.