脚本宝典收集整理的这篇文章主要介绍了php – Facebook API退出我的应用程序,但不是Facebook,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
这让我很好:
window.fbAsyncInIT = function() { FB.init({ appId : '<?= APP_ID ?>',status : true,cookie : true,xfbML : true,oauth : true,}); FB.Event.subscribe('auth.login',function(response) {alert(response); window.location = 'http://reviewsie.com/accounts/facebook'; }); }; (function(d) { VAR js,id = 'facebook-jSSDk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getelementsbytagname('head')[0].apPEndChild(js); }(document));
但是我点击我的网站上的注销,我将我的会话杀死到我的应用程序.然后,当你再次点击fb:LOGin-button时,它只是打开和关闭,并没有做任何事情,因为我仍然连接到Facebook.我希望它重定向.
但是,如果我退出时我也使用Facebook :: logoutUrl,它会将我从我的应用程序和Facebook中导出,这不是我想要的.
但是如果你真的想(hack),请在index.PHP中:
<?PHP require 'init.PHP'; // general init require 'init_fb.PHP'; // sets $fb_id if logged in to fb if (isset($fb_id) and !isset($_SESSION['do_not_auto_login'])) { echo "<a href='/logout'>logout</button>"; include 'app.PHP'; return; } if (isset($_SESSION['do_not_auto_login']) echo "<a href='/re_login'>FB Login</button>"; else include 'html_and_js_fb_login_code_and_button.PHP'; include 'startpage.PHP'; ?>
$_SESSION['do_not_auto_login'] = true; // destroy-code
在re_login.PHP中:
unset($_SESSION['do_not_auto_login']); header("location: /"); // re-direct back to index.PHP
不完美,但效果有点好.希望你得到黑客!
但是,为什么呢?如果您认为您的用户不想回来,请询问“如何从用户中删除我的fb-app?”或者别的东西或尝试@DMCS的答案..为什么?
以上是脚本宝典为你收集整理的php – Facebook API退出我的应用程序,但不是Facebook全部内容,希望文章能够帮你解决php – Facebook API退出我的应用程序,但不是Facebook所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。