MyBB Community Forums

Full Version: How to log out an user?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is it possible to force a specific user to log out? Using 1.6.9.

I can live with also forcing all users to log out, but I'd prefer to just affect one.
There is likely a way, but I'm not sure. I just change their password in the ACP and it will log them out once they click on the page. Then change it back to their old password. I never have to do it, but I've done it once.
(2012-12-28, 03:26 AM)DissociationFJ Wrote: [ -> ]I just change their password in the ACP and it will log them out once they click on the page. Then change it back to their old password.

Well,
  • I don't know their password (so I can't change it 'back').
  • I don't really want them to know I logged them out XD.
You can delete their session from the mybb_sessions table.
(2012-12-28, 03:42 AM)Nathan Malcolm Wrote: [ -> ]You can delete their session from the mybb_sessions table.

Sounds promising. I went ahead and found such table. However, I am confused: there is an uid column, which I suspect is the, well, user ID. But I see a bunch with a value of 0. Is that normal?
(2012-12-28, 04:12 AM)OmegaVemon Wrote: [ -> ]
(2012-12-28, 03:42 AM)Nathan Malcolm Wrote: [ -> ]You can delete their session from the mybb_sessions table.

Sounds promising. I went ahead and found such table. However, I am confused: there is an uid column, which I suspect is the, well, user ID. But I see a bunch with a value of 0. Is that normal?

Guests on the forums are assigned a uid of 0 as they're unregistered but still need a session. Smile
Ahh. Alright. I found the session with the corresponding uid. I will just delete it. So this will just log them out?

Thanks a lot, Nathan Smile

EDIT: Huh, this is odd... I tested this with my test account which was logged in in a different browser (Safari), and the account did not log out.
Ah, I see what the issue is. Scrap that suggestion, you'll want to change the 'loginkey' field in mybb_users to blank.

update mybb_users set loginkey='' where uid=x;
Works like a charm. Thank you, Nathan.

... I didn't hurt anything by deleting the session thing right? Lol XD
(2012-12-28, 04:44 AM)OmegaVemon Wrote: [ -> ]Works like a charm. Thank you, Nathan.

Happy to help. Smile

(2012-12-28, 04:44 AM)OmegaVemon Wrote: [ -> ]... I didn't hurt anything by deleting the session thing right? Lol XD

Sessions are just temporary pieces of data, no harm done.
Pages: 1 2