开发者

facebook: PHP graph api getting NULL session

I am following this tutoril. Though the user is logged in into facebook, but the session is showing him not logged in(NULL session). Please someone help me out. My code-segment is as follows-

$facebook = new Facebook(
                    array(
                    'appId'  => $app_config['app_id'],
                    'secret' => $app_config['app_secret'],
                    'cookie' =&开发者_如何学编程gt; true,)
                );

$session = $facebook->getSession();
var_dump($session);
$fbme = null;
if ($session) {
    try {
        $uid = $facebook->getUser();
        $fbme = $facebook->api('/me');
    } catch (FacebookApiException $e) {
        error_log($e);
    }
}


I had the same situation, changed to iFrame instead of FBML, it worked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜