XF 2.1 How to force logout all users?

But it won't log off users.

It only looks like this, test it once.
Users who are logged in via "stay logged in" are displayed as logged in when they reload your forum, but were actually logged out because the sessions are also emptied when the Mysql and apache2servers are stopped and then started again.
But I can also be wrong, I did not penetrate that deep into the XF code ... Test that yourself.

Otherwise, only an addon helps that loads all logged-in users into an for each array and simulates a click on their "logout button" so that their session and login is ended like this (examle): https://xenforo.com/community/logout/?t=1580630488%2(...)f768c6b

Addendum:
Also tested right now:
truncate tables: xf_session_activity and xf_session
 
Last edited:
  • Like
Reactions: rdn
If you use MySQL to store sessions, emptying xf_session or restarting MySQL (unless you have changed the Engine, by default it is Memory) will indeed logout all users.

If you also want to force users to really log in again even if they have a remeber cookie you will also have to empty table xf_user_remember (or at least remove non-expired entries).
If you do not do this, users with remember cookies will be logged out as well but immediately start a new session again when they make the next request.

If you cache sessions outside of MySQL (Redis, Memcache) you would have to remove them from there as well.
 
Top Bottom