简体   繁体   中英

Log out facebook when user doesn't give permission

My app (facebook-php) uploads images to the user's wall, and to a page. Everything works fine, even logging out after uploading.

There is a problem when the user logs in with his email and pw, and then presses cancel when asked for permission to get birthday etc. This moment, the user is logged in, but I can't make a valid logout link

$params = array( 'next' => 'http://localhost/index.php' );
$facebook->getLogoutUrl($params);

(access_token is "0").

The only way to logout is to go to facebook.com and click logout. Is there another way I can logout the user?

No, the user decides when he is logged out or logged in on Facebook, you cannot decide for him on this issue or even add such a button.

You need to adapt your application to handle that case instead, you cannot log out a user, but you can know if that user is logged in or not, and display your application accordingly.

Not quite an answer, but I worked around it. Installed an extension which enables me to inject the facebookpage with css. I disable the cancel button by setting it's display to 'none'...

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