In my application, I have an admin that can delete users. so when I delete a user from the admin session I want that the deleted user should get logged out automatically. I
Along with what has been suggested by @LaurentG, following needs to be added in your spring config file :
for it to work. Also @zygimantus answer can be used for accessing the session data.