标签: servlets spring-security listener
您已实施
ApplicationListener<AuthenticationSuccessEvent>
发生此事件时,我想为ServletResponse设置一个cookie。
我如何访问它?
我应该使用过滤器吗?但过滤器如何对此事件作出反应?
答案 0 :(得分:0)
尝试设置AuthenticationSuccessHandler。您将收到HttpServletResponse作为参数,因此使用cookie将没有问题。
AuthenticationSuccessHandler