javascript - Facebook Logout from app without session (user app authorization) -


I'm beating my head against a wall with a wall for a very long time like this.

I have a page outside Facebook, like a button. Because it should be on a public computer, we also need a visible logout-button. When "likes" is clicked, the user is prompted for login credentials. If they are okay, then such an event happens properly. The user should then be able to log out. Which does not work.

The button is now one-element when clicked, so it creates an edge. Generation is the event that I can hold well.

For logout button, I have selected 2 options.

First one:

  & lt; Fb: login-button autologoutlink = "true" & gt; & Lt; / Fb: login-button & gt;  

With this problem, the link remains in the form of a "login" form, such as after the page-refresh, even though the link is logged through the link.

and plain button, which triggers

  FB.logout {cout (feedback);});  

This gives an error called "FB.logout () without a session." It seems because the user has not authorized the application, therefore the application has no rights. Both logout-options work fine if the user has authorized the application The problem is, it is only asked when the "login" - Button is clicked. In this case the user will not have any meaning for the first entry and then click.

Any ideas how to work logout without getting the app authorization from the user? Or how "Appreciate" - will this app ask for authorization in the way of making a button?

I do not think this is possible.

You can check whether someone is currently logged into Facebook but not above you, which is as much as you can. If a user does not authorize your app, then you can not do anything with your login session (or data).

I do not think you should worry about public computers, though this is Facebook's problem after all, not yours. If a user checks "I remember" on a public computer during login, they will not click on your logout button.


Comments