@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Import(value=SpringHttpSessionConfiguration.class) @Configuration public @interface EnableSpringHttpSession
@Configuration
class to expose the
SessionRepositoryFilter as a bean named "springSessionRepositoryFilter" and backed by a
user provided implementation of SessionRepository
. In order to leverage the
annotation, a single SessionRepository
bean must be provided. For example:
@Configuration
@EnableSpringHttpSession
public class SpringHttpSessionConfig {
@Bean
public MapSessionRepository sessionRepository() {
return new MapSessionRepository();
}
}
It is important to note that no infrastructure for session expirations is configured for you out of the box. This is because things like session expiration are highly implementation dependent. This means if you require cleaning up expired sessions, you are responsible for cleaning up the expired sessions.
The following is provided for you with the base configuration:
SessionCreatedEvent
and
SessionDestroyedEvent
.