Take the 2-minute tour ×  When I run this code, and my cookies
have been cleared and I am not logged into facebook. It directs
me to facebook and I log in but when it brings me back to my
page it is the same, where as it should be show me profile pic
and so on...  I seem to have narrowed down the problem of the
return statement of the $user because it returns a 0. I have
stared at this code for a long time and I havent found what I am
doing wrong.  What do i need to change to get it so that When i
return from logging in from facebook it will show the profile
pic and so on...   require_once 'libs/facebook.php'; require
'connections/connection.php';  $facebook = new Facebook(array(
'appId' => 'xxxxxxxxxxxxx',             'secret' =>
'xxxxxxxxxxxxxxxx',  // Get User ID $user =
$facebook->getUser(); echo $user;  if ($user) {     try {
echo $user;     } catch (FacebookApiException $e) {
$user = null;  if ($user) {     //$logoutUrl =
$facebook->getLogoutUrl();     $logoutUrl = $facebook-