How to increase session timeout in Liferay?

Author: Ajay Choudhary

Liferay Version: 7.0, 7.1, 7.2, 7.3, 7.4

To increase session timeout in Liferay DXP, you need to adjust the session timeout settings in the portal-ext.properties file and the web.xml file. Here’s how you can do it:

1. Update the portal-ext.properties file

  1. Navigate to the folder where your Liferay instance is installed.
  2. Locate the portal-ext.properties file. If it doesn’t exist, you can create it in the same directory where portal-setup-wizard.properties is located.
  3. Add the following line to set the session timeout (in minutes). For example, to set the timeout to 60 minutes:
   session.timeout=60

2. Update the web.xml file

  1. Locate the web.xml file. This file is usually found in the WEB-INF directory of your Liferay installation, typically at {Liferay_Home}/tomcat/webapps/ROOT/WEB-INF/web.xml.
  2. Open the web.xml file in a text editor.
  3. Find the <session-config> section and set the session-timeout parameter. For example, to set the timeout to 60 minutes, it should look like this:
   <session-config>
       <session-timeout>60</session-timeout>
   </session-config>

3. Restart Liferay

After making these changes, you will need to restart your Liferay server for the changes to take effect.

Example for portal-ext.properties:

# Set session timeout to 60 minutes
session.timeout=60

Example for web.xml:

<web-app>
    ...
    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>
    ...
</web-app>

By setting these parameters, you increase the session timeout to 60 minutes. Adjust the timeout value as needed for your requirements.

Make sure to back up your configuration files before making any changes.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

close
Thanks !

Thanks for sharing this, you are awesome !