How do I check if the user is really loggedin? $facebook->getUser() still returns an ID after logout. Do I need to do something like $facebook->api('/me') just to check if the user is “really” logged in?
How do I check if the user is really loggedin? $facebook->getUser() still returns an
Share
Well, FB PHP SDK in my opinion is quite tricky because it relies on a cookie sent from Facebook when you are logging into the Facebook. This cookie is not deleted whilst logging out. Because of that in below code the variable $uid could store a proper user facebook id:
So, as far as I know, call
$facebook->api('/me');will tell the truth whether the user is logged in or not.I use above code in my production application and it works well.