掲示板

Session does not timeout after setting the session timeout property

thumbnail
10年前 に Liferay S によって更新されました。

Session does not timeout after setting the session timeout property

Junior Member 投稿: 53 参加年月日: 12/04/12 最新の投稿
Hi,

We are using Liferay 6.1 GA2.

We have a scenario where we set the following in my ROOT/web.xml
<session-config>
<session-timeout>2</session-timeout>
</session-config>

I start getting the warning message after 1 minute and the countdown starts from 59, so as to tell that the session will expire in this many seconds. Before session expires, I close the browser tab (not the browser window), suppose when the countdown is at 20 seconds. As per my understanding, ideally, even if I close the browser tab the session should expire in next 20 seconds, but if I open a new tab and hit http://localhost:8080/ I am still logged in to the portal i.e the session did not expire.

Is there any workaround, we could follow so that the session expires if the page is not refreshed.

Thanks in advance.

Regards..

添付ファイル:

thumbnail
10年前 に David H Nebinger によって更新されました。

RE: Session does not timeout after setting the session timeout property

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
You may see separate tabs as unique, but the browser does not. IE explicitly shares the session cookie between all browser tabs, so you're second tab is not separate at all, it's just a reconnect to the server. This new request within the timeframe results in a refresh of the expiration, extending it.
thumbnail
10年前 に Liferay S によって更新されました。

RE: Session does not timeout after setting the session timeout property

Junior Member 投稿: 53 参加年月日: 12/04/12 最新の投稿
Hi David,

Thanks for the response. I understand what you said. But if we take the above screenshot as an example, it shows 00:00:47, i.e in 47 seconds the session will go inactive. At this very moment I close the browser tab and then hit http://localhost:8080/ again on the same browser, but after 50 seconds, the user still is logged-in.

My concern is that if the session had to expire in next 47 seconds and I close the tab and reopen it after that time frame, still the user is logged-in. I hope I made myself clear ?

Thanks and Regards..
thumbnail
10年前 に Jose Jiménez によって更新されました。

RE: Session does not timeout after setting the session timeout property

Regular Member 投稿: 176 参加年月日: 12/08/23 最新の投稿
Hi,
The new request is processed by the portal, so this new interaction extends automatically the session.
Regards,
Jose
thumbnail
10年前 に David H Nebinger によって更新されました。

RE: Session does not timeout after setting the session timeout property

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Liferay S:
Thanks for the response. I understand what you said. But if we take the above screenshot as an example, it shows 00:00:47, i.e in 47 seconds the session will go inactive. At this very moment I close the browser tab and then hit http://localhost:8080/ again on the same browser, but after 50 seconds, the user still is logged-in.


I'm guessing there's an inconsistency to how the session timeout is defined in portal-ext.properties and ROOT/WEB-INF/web.xml...

Say we set portal-ext.properties to time out the session at 20 mins, web.xml has 30 mins, and warning is set for 1 min. The warning banner shows up in the browser, but you kill the browser before it's javascript invokes the server to expire the session at 20 mins.

When you restart the browser (before the 30 min mark expires), the session will still be alive.

Synchronize the value in web.xml with the portal-ext.properties and try it again...
thumbnail
10年前 に Liferay S によって更新されました。

RE: Session does not timeout after setting the session timeout property

Junior Member 投稿: 53 参加年月日: 12/04/12 最新の投稿
Hi David/Jose,

Thanks for the response.
That means if I set 10 mins in protal-ext.properties file, I should set the same value in web.xml file too.
At both the places, session time out should be same.

Regards...