Does webflux has the class like the InvalidSessionStrategy to do something when websession is valid
Comment From: rstoyanchev
when websession is valid
I presume you meant becomes "invalid". No, there aren't any explicit callbacks related to WebSession lifecycle. There is a public removeExpiredSessions() method on InMemoryWebSessionStore that is invoked to check and remove. It could be overridden to check for expired session and then delegate to the parent to actually remove them.
Comment From: chunaidong
I mean how to listen the webSession destory event on webflux. such as the session on servlet, just implements HttpSessionListener class , override sessionDestroyed method . like the follow code
public class SessionListener implements HttpSessionListener {
@Override
public void sessionDestroyed(HttpSessionEvent event){
//todo something when session valid ,like write logout log
}
}
Comment From: rstoyanchev
Yes that's what I presume you meant.
Comment From: rstoyanchev
The answer again is that there isn't any equivalent and the closest is the hook I pointed out.