Issue
Environment
- Liferay DXP
- Liferay Portal 6.2
Resolution
This is only happening under following circumstances:
- We've set in our portal-ext.properties session.timeout.auto.extend=true.
- We've set in our web.xml <session-timeout>1</session-timeout>.
- We are using Google Chrome 88+.
- We've left hidden our page for more than 5 minutes. We mean just to move to a different tab, so the tab where Liferay is running in Google Chrome is inactive.
In that case we'll see after that time our session is lost. That's due to some changes introduced in Google Chrome 88 in the way how they deal with timers when tabs are not active in order to optimize browser's performance. You can read further details in Google's article Heavy throttling of chained JS timers beginning in Chrome 88.
There are different ways to work around this behavior:
- Set, at least, <session-timeout>2</session-timeout> in web.xml file and set, at least, session.timeout.auto.extend.offset=60
- Set that same value to 0 so the session will never expire in the application server, although that could have some side effects you might need to consider.
- Use a different browser, such as Mozilla Firefox.
- Try to avoid leaving page inactive for more than 5 minutes.