JSF button to reset a session

Is there a way to reset a session for a user when he clicks a button?

+4
source share
1 answer

What about

session.invalidate(); 

The invalid session object method is used to drop the session and releases any objects stored as attributes. This method helps reduce memory overhead and achieve improved performance. It is always good practice to explicitly delete or terminate sessions using session.invalidate ().

or

 session.removeAttribute(String) 

The removeAttribute method of the session object is used to remove the attribute and value from the session.

+8
source

All Articles