I minimized my code as little as possible in order to isolate the error. I've already reviewed the forum for a simple answer, but no tips have solved this basic problem.
In the app settings, the only changes I made were to populate the url (localhost: 81 / mb - I already did the file editing and changing the domain and the result was the same) and set in App Center Permissions the Default Activity clause Privacy as Public. Do I need to do anything else?
This is a PHP page:
include_once 'libs/facebook/src/facebook.php';
$facebook = new Facebook(array(
'appId' => '###',
'secret' => '###',
'cookie' => true
));
$user = $facebook->getUser();
$login_url = $facebook->getLoginUrl();
echo 'Please <a href="' . $login_url . '">login.</a>';
if($user == null) {
print_r("user null " . $user);
} else {
print_r("user logged" . $user);
}
While logged in to facebook and using another Chrome tab, the result is "user null 0".