Avoid user login after every session timeout
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- On every session expire it is asking for user login again
Resolution
- Login after each session timeout is the default functionality of the Liferay portal.
- In order to avoid login after every session timeout, need to modify the session.timeout property through portal-ext.properties file and comment out the entry of the session.timeout property if it is set in the properties file.
Set the following property in portal-ext.properties:
session.timeout.auto.extend=true
- Specify the number of minutes before a session expires. This value is always overridden by the value set in web.xml.
<!-- ==================== Default Session Configuration ================= -->
<!-- You can set the default session timeout (in minutes) for all newly -->
<!-- created sessions by modifying the value below. -->
<session-config>
<session-timeout>5</session-timeout>
</session-config>
- Set the auto-extend mode to true to avoid having to ask the user whether to extend the session or not. Instead, it will be automatically extended. The purpose of this mode is to keep the session open as long as the user's browser is open with a portal page loaded. It would be better to use a smaller "session.timeout", such as 5 minutes, for better performance.
Did this article resolve your issue ?