2010-01-20 47 views
0

登录成功后,一个额外的cookie我想设置后用户登录成功的一个额外的cookie。在阅读AbstractProcessingFilter的源代码后,我发现它在登录后触发了InteractiveAuthenticationSuccessEvent。所以我可以为此编写一个ApplicationEventListener,但是如何在事件监听器中获取相应的HttpServletResponse如何设置在Spring Security

谢谢。

回答

1

对于这样的事情,你应该重写:

AbstractAuthenticationProcessingFilter.successfulAuthentication(
    HttpServletRequest request, 
    HttpServletResponse response, 
    Authentication authResult) 
+0

我想这一点,但是当我这个bean添加到'的applicationContext-security.xml',了rememberMe配置丢失(与比较''),现在我切换到spring security 3.0,它可以使用'' – lidaobing 2010-01-21 02:45:08

相关问题