Jump to the post that solved this thread.
Not Solved Logged Out on External Page
Not Solved
SOLUTION: Cookie path needs to be "/" (without the quotes) for this to work.

So I have created a custom page and used the php code below to login the user, check the username, and check the usergroup. When I visit the page I am logged out even though I am logged in on the forums. Any help is appreciated. Smile

<DIRNAME> is just my directory name that I want to keep private.

My forum is located inside a folder in public_html. (public_html/forums)

If you need my forum URL please contact me privately. I will give proof of purchase to the theme I am using to any MyBB staff that ask.

chdir('home/<DIRNAME>/public_html/forums'); // path to MyBB
define("IN_MYBB", 1);
require_once "../forums/global.php";
if(in_array($mybb->user['usergroup'] , array(1,7,5,18,19)))
// Rest of code
if($mybb->user['uid'] > 0)
    $uid  = $mybb->user['uid'];
    $user = get_user($uid);
    $name = $user['username'];
Jump to the post that solved this thread.

Forum Jump:

Users browsing this thread: 1 Guest(s)