Liferay Session Timeout

In this tutorial, we will look into Liferay session timeout. Liferay session time out has set to 30 minutes by default and loaded from below files:

  1. portal-ext.properties:  The below property will be used to set session timeout. This value is   always overridden by the value set in web.xm and changes will not take effect if there is session timeout entry in web.xml
     session.timeout=30

  2.  web.xml:    session time out is defined in web.xml and will take precedence over the portal-ext property file. You can verify the method checkWebSettings in MainServlet file:

<session-config>
        <session-timeout>30</session-timeout>
    </session-config>

How to change session timeout? 

  1. If you are using Hot Deployment and not creating tomcat structure dynamically then directly change the session timeout value in web.xml file
  2. If you are using Clean Deployment and loading entire tomcat directory then add web.xml dynamically into tomcat folder
  3. f your project has EXT plugin, then update web.xml there it self.  Do not create EXT plugin unless if your project has EXT.

How to redirect to particular page on session timout?  

Set the below property to redirect to page url defined in this property company.default.home.url

session.timeout.redirect.on.expire=true

1 Comment

  1. gopi

    How can liferay session timeout incremented dyanamically

    Reply

Leave a Comment

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