我认为 APP 访问令牌不会过期(如果您不更改应用程序密码左右)。但为什么我会收到此错误消息:
FacebookApiException: Error validating access token: Session has expired at unix time 1383138000. The current unix time is 1383138509.
当我尝试执行此 Facebook API 调用时:
$facebook = new Facebook(array(
'appId' => Yii::app()->params['fbAppId'],
'secret' => Yii::app()->params['fbSecret'],));
$multiQuery = array();
// get latest comment and like counts for each picture
foreach($data as $c=>$citem) {
// get CommentCount
$multiQuery['statCount_'.$c] = " SELECT comments_fbid, comment_count, like_count, share_count
FROM link_stat
WHERE url = 'http://MY_WEBSITE.net/".$citem->id."'";
$result = $facebook->api(array(
'method' => 'fql.multiquery',
'queries' => $multiQuery,
));
此错误主要发生在有人尝试在一天中第一次访问我的网站时 - 并且在刷新页面后 - 代码可以正常工作而没有任何错误。