简体   繁体   English

从应用程序FB.logout()中注销用户,而不是从Facebook中注销

[英]Logging out user from application FB.logout() not facebook

I have read Facebook documentation and it says that FB.logout is used to log the user out of both web application and Facebook. 我已经阅读了Facebook文档,并说FB.logout用于将用户从Web应用程序和Facebook中注销。 I have made a website on which I use FB.logout() but I want only the session of the user to be revoked not log the user out of the Faceboook. 我已经建立了一个使用FB.logout()的网站,但我只希望撤销用户的会话,而不希望使用户退出Faceboook。 I have seen this thing been done on many other websites looking at their code I find they are also using code like 我看过许多其他网站上的代码,发现他们也在使用类似

function fb_logout(){
            FB.logout(function(response) {
            console.log('loggedout');
            });
        }

I also tried using this function but I still log my users out of Facebook too. 我也尝试使用此功能,但我仍然将我的用户也注销了Facebook。 Is there a way to accomplish this task? 有没有办法完成这项任务?

You can just delete all the data you have on user and show them login button again (mimicking logout from your app) without calling "FB.logout" function(it logs user out of facebook too). 您可以删除用户的所有数据,然后再次显示它们的登录按钮(模仿从应用程序注销),而无需调用“ FB.logout”功能(也将用户从Facebook中注销)。 This will behave as per your needs, once user clicks on the login button again, you will again get the data without him needing to login to facebook again. 这将根据您的需要进行操作,一旦用户再次单击登录按钮,您将再次获得数据,而无需他再次登录Facebook。

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

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