Facebook getUser() function returning user ID after logout

后端 未结 5 1233
梦谈多话
梦谈多话 2020-12-28 18:28

I\'m developing using the Facebook PHP SDK.

I wanted to make it so that when the user logs out of Facebook, they will automatically be logged out of my website too.<

5条回答
  •  醉酒成梦
    2020-12-28 19:01

    The problem seems to be in php-sdk in basefacebook.php at line 567

             protected function getSignedRequestCookieName() {
             return 'fbsr'.$this->getAppId();}
    

    This method returns the name of the cookie the sdk is looking for. However, javascript-sdk uses 'fbs_' prefix. Change this to 'fbs_' and it works fine.

    return 'fbs'.$this->getAppId();}
    

提交回复
热议问题