views:

558

answers:

1

Hello,

I want set an extra cookie after user login successful. after read the source code of AbstractProcessingFilter, I found that it fire an InteractiveAuthenticationSuccessEvent after login. so I can write an ApplicationEventListener for this, but how can I get the corresponding HttpServletResponse in the event listener?

thanks.

A: 

For this kind of things you should override:

AbstractAuthenticationProcessingFilter.successfulAuthentication(
  HttpServletRequest request, 
  HttpServletResponse response,
  Authentication authResult)
rodrigoap
I tried this, but when I add this bean to `applicationContext-security.xml`, the rememberme config lost (compare with `<http auto-config="true">`), and now I have switched to spring security 3.0, which can use `<form-login authentication-success-handler-ref="foo">`
lidaobing