Does SessionStatus object.setComplete () clear all session attributes or just work for the controller in which it is used?

I don’t understand about this, if I use SessionStatus object.setComplete () in the controller, does it clear all Webapp session data or just clear the session data saved by the specific controller that uses @SessionAttributes?

+8
spring model-view-controller
source share
1 answer

SessionStatus#setComplete() JavaDoc quite clearly describes the purpose of the method:

 /** * Mark the current handler session processing as complete, allowing for * cleanup of session attributes. */ 

This clears the session attributes of the current handler registered through @SessionAttribute . This is completely different from the HttpSession#invalidate() servlet:

 /** * Invalidates this session then unbinds any objects bound to it. */ 

This actually completely destroys the user's session.

+11
source share

All Articles