有人可以告诉我为什么 facebook api 登录很慢。见http://www.deonlinefotograaf.nl/indexanders.php?action=login
至少需要 10 秒
我正在使用的代码:
$facebook = new Facebook(array(
'appId' => 'xxxx',
'secret' => 'xxxx',
'cookie' => true,
));
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($_GET['logout']=='Y') {
$logoutUrl = $facebook->getLogoutUrl();
header("Location: $logoutUrl");
exit;
}
if (!$user) {
$logurl = $facebook->getLoginUrl(array('scope' => 'email'));
header("Location: $logurl");
exit;
}