请参阅以下代码:
$fbconfig['appid' ] = "..........";
$fbconfig['api' ] = "..........";
$fbconfig['secret'] = ".......................";
try{
include_once "src/facebook.php";
}
catch(Exception $o){
echo '<pre>';
print_r($o);
echo '</pre>';
}
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
$user = $facebook->getUser();
$uid=$user;
问题在于......脚本在执行一次时工作正常。 (该脚本用于通过ajax调用在用户上传Facebook图片。 但是,如果再次立即调用脚本,或者在身份验证几分钟后调用脚本,则会出现以下错误:
Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in ..... on line 1125
请指教!