How To: Increase the session timeout for Java Connector Web applications


Steps to increase the timeout value of the servlet engine for a Web application by editing the application's web.xml file.


The web.xml file is the application deployment descriptor of the Web application. Information contained in this file is specific to the individual application and can be modified to meet its needs.

To increase the default session timeout value for the application:

  1. Navigate to the application's web.xml file and open in a text editor.

    This is usually located in the application's \WEB-INF directory.

    Windows : <drive>:\yourWebApp\WEB-INF\web.xml
    UNIX: ../yourWebApp/WEB-INF/web.xml

  2. Insert the following code between the tags <wep-app></wep-app>.


    The value 30 is the timeout in minutes. Use a value appropriate for the Web application.

    Some Web server/servlet engine combinations may impose the order of elements contained within the web.xml file. Refer to the document type descriptor (dtd) used in the application's web.xml file (eg. http://java.sun.com/j2ee/dtds/web-app_2_2.dtd) for the order of elements.

  3. Save and close the file.
  4. Restart the Web server/servlet engine.

    For some Web server/servlet engine combinations you may need to re-deploy the Web application.

Last Published: 5/5/2016

Article ID: 000005276