Dec 19th, 2012, 04:27 AM
Destroy a session of another user
Hello, in my application I have a admin that can delete users so when I delete a user I want that the user log out automatically.
I know user's session id who I delete but I don't know how invalidate a session using the session id.
I would like something like: invalidate(SessionId);
Is it possible in any way?
Dec 20th, 2012, 01:29 AM
You can do this when you have Spring Security and have enabled SessionManagement / SessionTracking else it isn't going to be possible.
Another way would be to create a filter which checks if the user is still valid (when the user issues a request) if not, logout user and show page.
Feb 28th, 2013, 07:09 AM
My idea is when I do delete(user) in the controller, the controller gets the session of the user and destroy it, but I think it isn't possible.
The best way that exists, I think is to create a filter and check if the user is in DB if isn't destroy the session.
Tags for this Thread