I am building a membership site which is built around the phpbb3 login system. Once a user is logged into phpbb3 then they can access all members area only pages, one will be the chat room.
So I want to auto login with the phpbb3 user name....
I can't seem to get the login hook to read my chatname variable and I've gone as far as using sessions.
Here is where i am at...
- Code: Select all
//stores the current logged in username into the session chatname variable
$_SESSION['chatname'] = $user->data['username'];
Then I go to the config.php file.
at the top I do a
- Code: Select all
session_start();
then...
- Code: Select all
$GLOBALS['pfc_hooks']['pfc.before.auth'][5] = function ($app, $req, $res,) {
return function () use ($app, $req, $res,)
{
var_dump ($_SESSION['chatname']);
return ($_SESSION['chatname']);
};
};
When go to the chatroom page, nothing comes up for the var_dump and the chat room is blank and does not ask for a login.
Any thoughts to why this isn't working?