Reputation: 34424
Httpsession is per browser.Ideally should we reset the session variables on logout otherwise it will always be available for that Browser even user login again.Is that correct?
Upvotes: 1
Views: 3742
Reputation: 181340
You don't need to reset all session variables. You just need to call session.invalidate()
and servlet framework will take care of the rest.
Upvotes: 0
Reputation: 62593
You can just invalidate the session by calling HttpSession.invalidate()
which will clear all the attributes as well as destroy the session itself.
Upvotes: 3