Manually Logout a user with logoutkey?
#1
I currently using this line of code to manually or force the user to log out.
$db->update_query("users", array("loginkey" => ""),"uid = '{$mybb->user['uid']}'");

It is working for logout. But this will remove the loginkey. Anyone knows how to do it?
Reply
#2
actually logoutkey is used in the logout link - not directly related to database query.

see related logout fuctionality in member.php file which might help for your requirement

unset cookies mybbuser & sid should result in user logout
Reply
#3
You could just generate a new loginkey for the user.

require_once(MYBB_ROOT . 'inc/functions_user.php');
update_loginkey($mybb->user['uid']);
Reply
#4
Out of curiosity, why would anyone want's to force logout their member's without them knowing !

It's such an bad impressions from user's point of view..
Reply
#5
^ well, it is a functionality required for a different purpose here - single sign on
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)