Session Liferay:在每次登录时获取唯一的会话id

Session Liferay:在每次登录时获取唯一的会话id,session,jboss,liferay,Session,Jboss,Liferay,我正在编写一个代码,对应用程序上的每个登录进行审计跟踪。为此,我使用AuditRequestThreadLocal.getSessionID()从AuditRequestThreadLocal对象获取会话id 问题是:每次登录时为用户提供相同的sessionId(同一用户的多次登录)。 关于这一点,我从HttpRequest获取sessionId,但它也会在每次登录时为该用户返回相同的sessionId (在TOMCAT的情况下,它似乎工作正常,但在JBOSS的情况下,它返回相同的session

我正在编写一个代码,对应用程序上的每个登录进行审计跟踪。为此,我使用AuditRequestThreadLocal.getSessionID()AuditRequestThreadLocal对象获取会话id

问题是:每次登录时为用户提供相同的sessionId(同一用户的多次登录)。

关于这一点,我从HttpRequest获取sessionId,但它也会在每次登录时为该用户返回相同的sessionId

(在TOMCAT的情况下,它似乎工作正常,但在JBOSS的情况下,它返回相同的sessionId)


谢谢。

您可以尝试使用此解决方案:

在portlet.properties中,设置session.enable.phishing.protection=true:

#
# Set this to true to invalidate the session when a user logs into the
# portal. This helps prevents phishing. Set this to false if you need the
# guest user and the authenticated user to have the same session.
#
# Set this to false if the property "company.security.auth.requires.https"
# is set to true and you want to maintain the same credentials across HTTP
# and HTTPS sessions.
#
session.enable.phishing.protection=true

您可以尝试在门户ext中应用以下属性:

session.enable.phishing.protection=true
session.phishing.protected.attributes=OPEN_ID_CONNECT_SESSION

启用网络钓鱼保护会在访客用户出现时导致错误;基本上,它给出SessionError的null值。因此,我无法启用此属性。不过,还是在寻找新的方法。