$facebook = new Facebook(array(
appId => xxx ,
secret => yyy ,
cookie => true
));
$user = $facebook->getUser();
if ($user) { // Checks if there is already a logged in user
try {
// Proceed knowing you have a logged in user who s already authenticated.
$user_profile = $facebook->api( /me );
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
else {
//Ask for bare minimum login
$login_url = $facebook->getLoginUrl();
header("Location: ".$login_url);
}
My problem is that the $user
is FB logged in, but $facebook->api( /me )
not only fails, but I don t get the App authorization dialog either.
What am I doing wrong?