dongyi5570 2011-03-24 10:42
浏览 46
已采纳

通过Facebook连接成功验证后,如何从URL隐藏会话信息?

I am using facebook connect in one of my website. For this i have used php sdk library.

I am using following code:

<?php
  require APP_PHYSICAL_PATH.'includefiles.php';
  $loginUrl = $facebook->getLoginUrl(
        array(
        'req_perms' => 'email,user_location',
        'next'=>APP_URL.'views/search.php?validate=true'

        )
);
?>  
   <a href="<?php echo $loginUrl; ?>">
    <img src="http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif">
  </a>

The problem is that after successful authentication it goes to search page but it shows session information in the url. For e.g.

http://mydomain/views/search.php?validate=true&session={"session_key"%1A"4.7REQluh3EVBGKiA5m8cNlg__.6600.1700968000-900001178893860"%  

I want that this session information should not be visible. Is there any way to accomplish this?

Please help me on this

Thanks

Pankaj

  • 写回答

1条回答 默认 最新

  • dsgft1486 2011-03-24 11:00
    关注

    My solution to this problem was the following:

    • When the user clicks the Facebook login button, a popup window appears (preferably without the URL input bar). Also, you can pass a 'display' => 'popup' parameter to the getLoginUrl method, as this will use another layout for the Facebook connect page which is more suitable for popup windows.
    • When the Facebook login and permission granting is successful, Facebook redirects you to that URL you don't want to show.
    • On the page you're redirected to, you should echo a javascript which closes the window.

    Another solution would be to do this entire connect stuff inside an iframe (though I haven't tested this approach).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?