延长 Liferay 6.1 会话

Extending Liferay 6.1 session

我想延长 Liferay 6.1 会话,我考虑过在会话即将到期时显示对话框或类似的东西。我知道Liferay有类似的东西,我可以设置f.e.

session.timeout.warning = 5 

当会话到期 5 分钟时,会出现一条消息和一个按钮,用于将会话再延长 5 分钟。

现在,问题是:是否可以更改延长值(而不是 5 分钟,我想将其延长到 30 分钟)但我仍然希望在到期前 5 分钟显示警告消息?

编辑:不确定它是否真的重要,我使用的是 Liferay 6.1

更新

最后证明 Rushikesh 一直都是对的。 Liferay 6.1.1 中存在一个错误,它会导致显示有关通过 timeout.session.warning 值而不是 timeout.session 扩展会话的错误消息。它已在 Liferay 6.1.3 中修复,请参阅 here

你当然可以延长 Liferay 会话,并显示会话过期警告,但不能仅使用 session.timeout.warning = 5 属性.

Liferay 的会话超时默认为 30 分钟,这是通过其 web.xml 文件控制的。

described here一样,portal-ext.properties 文件具有以下用于配置会话超时警告的设置。它们仅用于在顶部弹出会话超时警告消息的javascript:

#
# Specify the number of minutes before a session expires. This value is
# always overridden by the value set in web.xml.
#
session.timeout=30

#
# Specify the number of minutes before a warning is sent to the user
# informing the user of the session expiration. Specify 0 to disable any
# warnings.
#
session.timeout.warning=5

当用户点击警告消息上的 'Extend' 按钮时,Lifeary 的会话将延长 'session-timout' 值(例如,在本例中为 30 分钟)。

HTH!