i spent all day searching for an answer.. but it seems that nothing can fix it. i guess every version had a different issue...
well it's pretty simple, i have this code:
<?php
include_once("facebook.php"); //include facebook SDK
######### edit details ##########
$appId = '****'; //Facebook App ID
$appSecret = '****'; // Facebook App Secret
##################################
//Call Facebook API
$facebook = new Facebook(array(
'appId' => $appId,
'secret' => $appSecret,
'cookie' => true
));
$fbuser = $facebook->getUser();
if ($fbuser) {
// Do Something
}
else{
//Show login button for guest users
$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$homeurl,'scope'=>$fbPermissions));
echo '<a href="'.$loginUrl.'"><img src="images/facebook-login.png" border="0"></a>';
}
?>
i get 0 in get user every time. when i go to "login on facebook" and im not logged in, i get facebook login screen. when i go to "login on facebook" and im logged in, facebook redirect me to my page and i get 0 in get user again.
i'm tring to run it on my localhost, maybe thats the problem?
hope someone can help.. thx