Cannot grab correct UID from hook
#7
If you are hooking into datahandler_login_complete_end, the $mybb->user object is still stuck to a general guest data. The user data will be loaded afterwards, so you should grab the authenticated user data by using the argument passed in the hook, which is a "by-reference" hook type:

function myplugin_datahandler_login_complete_end($user)
{
  global $session;

  setcookie('my_session', $user['uid'] . ' ABCDE ' . $session->sid, time() + (86400 * 30), "/");    
}
[Image: fSGNVQj.png]
Reply


Messages In This Thread
Cannot grab correct UID from hook - by Dexie - 2015-09-23, 09:11 PM
RE: Cannot grab correct UID from hook - by SvePu - 2015-09-24, 10:01 AM
RE: Cannot grab correct UID from hook - by Dexie - 2015-09-24, 08:42 PM
RE: Cannot grab correct UID from hook - by RateU - 2015-09-24, 08:53 PM
RE: Cannot grab correct UID from hook - by Dexie - 2015-09-24, 11:38 PM
RE: Cannot grab correct UID from hook - by RateU - 2015-09-25, 12:25 AM
RE: Cannot grab correct UID from hook - by Shade - 2015-09-25, 10:04 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)