0

Hi all,

I am using the PHP Facebook SDK to login users. A login button validates the user and returns to a callback 'fb-callback.php'. On this page, I dump the returned data into a mySQL table, start a Session, and redirect to the homepage.

As a test, I stopped the redirect and dumped the session data, and everything looks okay. However, when I dump the session data on any other page, the session doesn't seem to have any data!

Am I supposed to pass it between pages? My understanding was that Session was superglobal, so wht is it not passing between my pages?

To load the session data, I simply use:

    //Load Session
    $user = $response->getGraphUser();
    $_SESSION = $user;

I also start a new session on each page.

Can someone help?

2
Contributors
2
Replies
10
Views
1 Year
Discussion Span
Last Post by James_43
0

Yeah I do.

The issue was I needed to store the data under a session array, not into the session itself. When I changed:

$_SESSION = $user;
to
$_SESSION['user'] = $user;

The problem resolved.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.