facebook:PHP 图形 api 获取 NULL 会话
我正在关注这个教程。虽然用户已登录 Facebook,但会话显示他未登录(NULL 会话)。请有人帮助我。我的代码段如下-
$facebook = new Facebook(
array(
'appId' => $app_config['app_id'],
'secret' => $app_config['app_secret'],
'cookie' => 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 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' => 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);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的情况,改为 iFrame 而不是 FBML,它起作用了。
I had the same situation, changed to iFrame instead of FBML, it worked.