Facebook 邀请并返回后,我的所有会话都消失了
我想让客户邀请朋友进入我的网站客户区。
客户登录我的网站客户区后,所有个人会话数据都会照常创建。
然后,客户点击 Facebook 连接,授予权限,并显示他们可以勾选邀请的朋友列表。
邀请完成并再次返回同一页面后,我所有的网站会话数据都消失了。只留下了 facebook 会话(access_token、base_domain、expires、secret、session_key、sig)
我想知道为什么......
我想取回所有现有的会话数据以便执行其他活动。
有什么办法可以回来吗?
session_start();
if($_SESSION["username"]=="") {
}
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
$sessionfb = $facebook->getSession();
//此 facebook getsession 使用最新的 facebook.php 提供的sdk 的一部分
$loginUrl = $facebook->getLoginUrl(
array(
'canvas' => 1,
'fbconnect' => 0,
'req_perms' => 'email,publish_stream,status_update,user_birthday' )
);
$fbme = null;
print_r($_SESSION);
<fb:serverFbml style="width: 500px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="<?=$fbconfig['baseUrl']?>/index.php"
target="_top"
method="POST"
invite="true"
type="testing"
content="testing <fb:req-choice url='<?=$fbconfig['appBaseUrl']?>' label='Accept' />"
>
<fb:multi-friend-selector
showborder="false"
actiontext="testing ">
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
I want to let customer invite friends inside my website customer area.
After customer login to my website customer area, all the personal session datas created as usual.
Then customer click to facebook connect, grant permission and being shown a list of friends that they can tick to invite.
Once the invitation done and back to the same page again, all my website session datas gone. Only left the facebook sessions (access_token, base_domain, expires, secret, session_key, sig)
I wonder how come...
I want back all my existing session datas in order to perform other activities.
Any way to get back?
session_start();
if($_SESSION["username"]=="") {
}
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
$sessionfb = $facebook->getSession();
//this facebook getsession is using the latest facebook.php provided as part of the sdk
$loginUrl = $facebook->getLoginUrl(
array(
'canvas' => 1,
'fbconnect' => 0,
'req_perms' => 'email,publish_stream,status_update,user_birthday' )
);
$fbme = null;
print_r($_SESSION);
<fb:serverFbml style="width: 500px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="<?=$fbconfig['baseUrl']?>/index.php"
target="_top"
method="POST"
invite="true"
type="testing"
content="testing <fb:req-choice url='<?=$fbconfig['appBaseUrl']?>' label='Accept' />"
>
<fb:multi-friend-selector
showborder="false"
actiontext="testing ">
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,当您使用 canvas=1、fbconnect=0 时,登录网址中表示您在 facebook 中有一个 facebook 应用程序。您指定 canvas=1 和 fbconnect=0。如果您要将 facebook 嵌入到您的网站中,那么您必须进行对比。 fbconnect=0 表示您没有在您的网站中嵌入 facebook。
As for as I know in login url when you use canvas=1, fbconnect=0 then it means that you have an facebook application within facebook. you are specifying canvas=1 and fbconnect=0. If you are embedding facebook in your site then you must do the contrast. fbconnect=0 means you are not embedding facebook in your site.