2010-01-20 51 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

相關問題