Can't Logout of my Facebook OAuth Session without logging User Out of Facebook

后端 未结 2 1800
栀梦
栀梦 2021-01-03 09:13

Per the SDK, I am using the logout.php with redirect:

https://www.facebook.com/logout.php?confirm=1&next={SOME URL}&access_token={ACCESSTOKEN}
         


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-03 09:25

    This is one of the many annoying things about developing on the Facebook platform. The only way to log out via a browser session is to use their javascript logout function or the redirect like you tried but either will also log the user out of Facebook which is very annoying from a users perspective. The problem is you can't access the cookie they set for your app to delete it due to cross-domain restrictions so you are stuck with the limited options Facebook provides. If you are not prompting for offline_access, you could just forget the users access token and it will expire after an hour. Although the problem still exists that the cookie is still set for within that hour.

提交回复
热议问题