Facebook APP令牌FQL查询:验证访问令牌时出错

时间:2013-10-30 13:22:12

标签: facebook facebook-graph-api

我认为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,
            )); 

此错误主要发生在有人试图在一天内第一次访问我的网站时 - 刷新页面后 - 代码正常运行。

0 个答案:

没有答案