Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am not clear about this if I use SessionStatus object.setComplete() in a Controller, does it clears all the session data of the Webapp or just clears the session data saved by a particular controller in which @SessionAttributes is used?

like image 222
user2472968 Avatar asked Jun 11 '13 07:06

user2472968


1 Answers

SessionStatus#setComplete() JavaDoc is pretty clear about the method's purpose:

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

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

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

This one actually destroys the user session completely.

like image 53
Pavel Horal Avatar answered Nov 10 '22 13:11

Pavel Horal