1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Log-out all users

Discussion in 'XenForo Questions and Support' started by SpencerSharkey, May 19, 2013.

  1. Hi!

    The question is simple, we need a way to log out all the users currently signed in and remembered.
    I tried removing the session rows from the xf_session table but it didn't work.

    Any leads on this would be great, thanks.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    I haven't tested this but changing the cookie prefix in library/config.php should do it.
    $config['cookie'] = array(
    'prefix' => 'yourprefix_',
    'path' => '/',
    'domain' => ''
    Why do you need to force log out for all of the members?
    Jake Bunce likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    ^agree with Brogan

    Note that the default cookie prefix is 'xf_' so you need to use something different. That will invalidate all existing login and "remember me" cookies thereby forcing everyone to login again.
    Brogan likes this.
  4. Yeah :) It worked. Should of thought of that in the first place.

    Thanks guys
  5. Deepmartini

    Deepmartini Well-Known Member

    Is there an addon which the admin can use to force a member to logout? That way if you have someone disrupting your site, you can force logout (and ban them?). Or maybe just log them out for 24 hours. I didn't see this anywhere in the control panel so not sure if this is an option.
  6. Jeremy

    Jeremy Well-Known Member

    The only option you have is to temporary ban them, you can invalidate the cookies, but that'll only work once.
  7. Deepmartini

    Deepmartini Well-Known Member

    Do you think an addon that does this would be easy to create?
  8. Jeremy

    Jeremy Well-Known Member

    I see no reason for one, just temporarily ban the user. You could in theory just invalidate his password; but that'd require him/her to be logged out before visiting your site.
  9. NeoCHI

    NeoCHI Active Member

    I don't see this line anywhere in library/config.php anymore:
    'prefix' => 'yourprefix_'​
    How can I logout all users now?
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You would just manually add it to the config.php file.

Share This Page