我希望从我的p:commandButton中进行正常注销:
我的后端bean中有这样的函数:
public void logout() {
SecurityUtils.getSubject().logout();
SavedRequest savedRequest = WebUtils.getAndClearSavedRequest(Faces.getRequest());
if (savedRequest == null) {
Faces.redirect("/common/login.jsf");
} else {
Faces.redirect(savedRequest.getRequestUrl());
}
}但我得到了这个
由: org.apache.shiro.session.UnknownSessionException:引起,不存在id b4a41562-0d9e-4fc9-9d9d-ef7724d8efad的会话。
知道我能怎么解决吗?我也在使用Omnifaces库。
知道是怎么回事吗?
我使用的是: Shiro 1.7.0和Omnifaces 3.10.1
发布于 2021-04-21 17:08:19
Shiro的Subject.logout()本质上清除了会话(session.invalidate())。如果会话已被清除,您将无法再次清除它。
如果您正在使用Shiro注销滤波器,则不需要对logout()进行额外调用。
https://stackoverflow.com/questions/67183413
复制相似问题