我在 LoginSuccessHandler(extending CustomAuthenticationSuccessHandler) 中设置了一个会话属性,例如
public void onAuthenticationSuccess(HttpServletRequest request,
HttpServletResponse response, Authentication authentication)
throws IOException, ServletException {
HttpSession session = request.getSession();
session.setAttribute("TICKET", "dummyVAL");
}
我想在 LogoutSuccessHandler(扩展 SimpleUrlLogoutSuccessHandler)中检索相同的值。但是当我这样做时
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
HttpSession session = request.getSession();
session.getAttribute("TICKET");
}
我得到空值。如何在成功处理程序中设置的登录处理程序中检索会话值。