1

请看下面的代码:

 $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

请指教!

4

0 回答 0