在我的脸书应用程序中,由于以下两行,我得到了一个无限重定向循环,虽然它昨天正常工作!
$loginUrl = $facebook->getLoginUrl(array('redirect_uri' => $fbconfig['appUrl'], 'scope' => 'user_birthday,email'));
print "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
显然问题在于从API获取用户数据:
if ($user) {
try {
// If the user has been authenticated then proceed
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}