Is there a way to reset (clear) the session for a user, when he clicks on a button?
Asked
Active
Viewed 3,873 times
1 Answers
8
What about
session.invalidate();
invalidate method of session object is used to discard the session and releases any objects stored as attributes. This method helps to reduce memory overhead and achieves improvement in performance. It is always a good practice to explicitly remove or invalidate sessions using session.invalidate() method.
or
session.removeAttribute(String)
The removeAttribute method of session object is used to remove the attribute and value from the session.

rahul
- 184,426
- 49
- 232
- 263