0
我一直在嘗試新的身份驗證,但有時會發生在第一次訪問應用程序一次又一次刷新。 (我的意思是如果沒有cookies是set..first有史以來時間或例如瀏覽器重新啓動後)應用程序身份驗證刷新
我有認證驗證碼:
require_once './facebook/facebook.php';
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'fileUpload' => $fbconfig['fileUpload'],
'cookie' => true,
));
$uid = $facebook->getUser();
if($uid)
{
session_start();
if(!isset($_SESSION['me']))
{
try
{
$_SESSION['me'] = fql("select name, sex, pic_big, locale, email, birthday from user where uid=me()",$facebook);
$_SESSION['me'] = $_SESSION['me'][0];
}
catch(Exception $o)
{
print_r($o);
}
}
}
else
{
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => $fbconfig['perms'],
'redirect_uri' => $fbconfig['canvas'],
)
);
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
exit;
}
所以誤差爲$ facebook->的getUser();它是0.但是,當我停止刷新,並再次去那裏..它正常工作。