Change user timeout period in Tomcat

If you are using Tomcat as the application server and you want to change the time out period in Tomcat. By default, Tomcat logs you out of your Semarchy Application after 30 minutes, follow this guide to increase the time-out period to 3 hours.

Instructions

Semarchy does not set a timeout period. Therefore, Tomcat uses its default value of 30 minutes. It's often convenient to increase this time out period so you do not need to log in as frequently.

  1. Back up the web.xml file contained at the path /etc/tomcat8/web.xml
  2. Stop Tomcat: sudo service tomcat8 stop
  3. Edit the web.xml file.
  4. Change the following session-time value from 30 to 180:
    1. Change this:
      <session-timeout>30</session-timeout>
    2. To
      <session-timeout>180</session-timeout> <!-- 3 hours -->
  5. Restart tomcat: sudo service tomcat8 start


Remember the timeout period also applies to the REST API sessions. You may end up with dozens of REST API sessions that remain open after making a connection because of the delayed timeout period. You can use Tomcat Manager to disconnect these sessions if they become an issue.