Java spring HttpSessionListener

I wrote my own SessionExpireListener

that will be called when the session is deleted. All my sessions are stored in redis. So I am using annotation @EnableRedisSession(maxInactiveIntervalInSeconds = 10)

. When I start my server the sessionCreated(HttpSessionEvent event)

. After 10 seconds the session is removed from redis but no sessionDestroyed

event is raised.

@Component
public class SessionExpireListener implements HttpSessionListener {

    private static final Logger LOG = LoggerFactory.getLogger(SessionExpireListener.class);

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        LOG.info("Session has been destroyed...");
    }

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        // TODO Auto-generated method stub
        LOG.info("Session has been created...");
    }
}

      

The console does not display LOG. SessionDestroyed is never called.

+3
spring-boot httpsession servlet-listeners spring-session


source to share


No one has answered this question yet

See similar questions:

0
Failed to capture SessionDestroyed event in Spring Redis Session + Spring boot framework

or similar:

708
How to configure port for Spring Boot application
23
How do I inject dependencies into an HttpSessionListener using Spring?
five
Spring Security OAuth2 Redirect Loop
2
Migrating HttpSessionListener after accepting spring sessions
2
HttpSessionListener implementation
1
Spring HttpSessionListener gets caught in a loop
1
Getting SessionScoped bean from HttpSessionListener?
0
Spring Boot + Spring Session HttpSessionListener not working
0
conversation is destroyed when the session is canceled
0
Glassfish creates more than one http session in real time authentication



All Articles
Loading...
X
Show
Funny
Dev
Pics