How to kill the session on browser (tab or window) close?
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
learn-legacy-article-disclaimer-text
Issue
- The user session should be terminated immediately if they close the browser tab or window.
Resolution
- Liferay maintains the session of 30 minutes by default and Liferay doesn't provide any such kind of OOTB feature or property to fulfill the business-specific requirements.
- This Business-specific requirement might be achieved by having a functionality where your browser will not be able to store a cookie for longer and will be forced to log out as soon as the browser tab is closed.
-
There is a possible workaround where one can shorten the session duration to a minute or less than 5 min with no session warning timeout prompt which will close the user session if the page is ideal for that particular amount of time.
did-this-article-resolve-your-issue