Search code examples
grailsspring-securitygrails-2.2

is there a way to logout a specific user or all users from database?


I am using grails 2.2 with spring security. I am using MYSql for database. I am wondering whether there is a way to logout a user or all users by clearing data in mysql database.


Solution

  • I am wondering whether there is a way to logout a user or all users by clearing data in mysql database.

    There isn't. The state that represents whether a user is logged in or not generally does not even exist in the database. In a simple system that information would live in memory in the web app. In a more sophisticated system that information might live in a separate service that the app communicates with. That information generally would not be stored in the database.

    Note that storing credentials like user names, passwords and roles in the database is a separate thing than keeping track of who is logged in.

    I hope that helps.