Drupal - How to logout all active users?
As far as I know you can empty the sessions table and all users will be logged out. There may be an issue though, depending on the modules that you have installed. For example, modules that implement hook_user_logout()
will never get their actions fired, which could be an issue. Check to make sure none of your installed modules is implementing this hook.
You can empty the sessions table using drush
drush sqlq "TRUNCATE sessions"
or if you have set prefixes for table names:
drush sqlq --db-prefix "TRUNCATE {sessions}"
Use Force Logout Module ..
Features
- Settings form where you can enable and disable (Force logout).
- Permission so you can exclude some user roles if you want to exclude administrator for example.