I want to listen to session life cycle events. I read about adding
org.springframework.security.web.session.Http
Just to provide reference to official documentation, http://docs.spring.io/spring-session/docs/current-SNAPSHOT/reference/html5/#httpsession-rest
Here if you refer to, HttpSessionListener
topic, you will find the clear example of doing it both Java
and XML
configuration way.
if your configuration support Redis
@Configuration
@EnableRedisHttpSession
public class RedisHttpSessionConfig {
@Bean
public HttpSessionEventPublisher httpSessionEventPublisher() {
return new HttpSessionEventPublisher();
}
// ...
}
In XML configuration, this might look like