简体   繁体   English

如何使用我的php网站从facebook注销

[英]How to logout from facebook using my php web site

How to logout from facebook using my php web site 如何使用我的php网站从facebook注销

this function detect as a logout,but my facebook account still not logout 此功能检测为注销,但我的Facebook帐户仍未注销

<script>
function Logout()
    {
        FB.logout(function () {
            document.location.reload();
        });
    }
</script>

Javascript is client side. Javascript是客户端。 And Session is server side. 而Session是服务器端。

So, using javascript you can't Logout from facebook. 所以,使用javascript你不能从Facebook注销。 because facebook SDK's function sometimes doesn't terminate user session. 因为facebook SDK的功能有时不会终止用户会话。 So best practice is in your file put session_destroy() function if you want to destroy all the session variables or simply use print_r($_SESSION) and find out the session variables of facebook and unset those variable using unset($foo); 所以最好的做法是在你的文件中放入session_destroy()函数,如果你想销毁所有会话变量或者只是使用print_r($_SESSION)并找出facebook的会话变量并使用unset($foo);设置这些变量unset($foo); if want to continue other session variable. 如果想继续其他会话变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM