简体   繁体   中英

logging out a user from facebook app

it seems that this method doesn't work for logging out the user from an app on facebook, i dont want to log the user from facebook itself like with getLogoutUrl, only from the app.

if the user uncheck the email field on the dialogue box the first time he log in with facebook, he needs to logout from the app, in order to log in again without unchecking the email field, so he have a second chance of signing in to my site.

this method doesn't work anymore:i'm on php SDK V4

setcookie('fbs_455857397897935','', time()-100);

// kill the session session_destroy();

455857397897935 is the app id

You could try to revoke users login using graph API

DELETE /{user-id}/permissions

Quoting from docs:

You can also let people completely de-authorize an app, or revoke login, by making a call to this Graph API endpoint:

DELETE /{user-id}/permissions This request must be made with a valid user access token or an app access token for the current app. If the request is successful, your app receives a response of true. If the call is successful, any user access token for the person will be invalidated and they will have to log in again. Because you're de-authorizing your app, they will also have to grant access to your app as if they were logging in for the first time.

Hope this helps your usecase.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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