MyBB Community Forums

Full Version: Cannot reach loginkey outside mybb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am using MyBB 1.6.8 with the MyBBIntegrator

I am having issues logging out externally from MyBB, i have no problem at all logging in, i am trying the normal $MyBBI->logout(); function, but it does not work.

function_logout

The logoutkey does not show up outside mybb, in other words, the variable does not exist..

example.com?logoutkey=THE_LOGOUTKEY_OF_THE_USER
You can access the logoutkey with $MyBBI->mybb->user['logoutkey']

This is what i have (logoutkey is blank):
<?php
define('IN_MYBB', NULL);
global $mybb, $lang, $query, $db, $cache, $plugins, $displaygroupfields;
require_once '/xxx/xxx/mybbforum/global.php';
require_once '/xxx/xxx/class.MyBBIntegrator.php';
$MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);

print $MyBBI->mybb->user['logoutkey'];
?>

Could someone give me a helping hand? I'd be gladful.
if you print_r($MyBBI->mybb->user) does it show you as logged in and if so, does it list a logoutkey?
(2012-07-03, 06:26 PM)pavemen Wrote: [ -> ]if you print_r($MyBBI->mybb->user) does it show you as logged in and if so, does it list a logoutkey?

This is pretty wierd,

I am successfully logged into the forums with the correct user credentials but uid=0 and i do not know why.

Got any clue?
not without digging into it directly. sorry
Ok,

I have changed the following settings:

Cookie domain: (blank)
Cookie path: /

It works now, and my loginkey is shown outside mybb.

Issue is solved.
I apologize for replying to an old and dead thread but Just want to say thanks @bowkilled you solved my issue Wink
as the system did not work outside of the mybb forum directory.