Results 1 to 3 of 3

Thread: Destroy a session of another user

  1. #1
    Join Date
    Jul 2012
    Posts
    7

    Post 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?

    Thanks.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jul 2012
    Posts
    7

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •