I’m having a problem with a facebook Iframe application. My problem is that if a user logs in to the app, then logs out of the application and another (different) user logs in, the $facebook->getUser() returns the id of the previous user.
I tried to send the user to the login url each time, but it still happens untill the page is refreshed once (first login to app takes the previous user fb session, then its ok).
The only lead I was able to find was that this happens due to the persistent data in the $facebook->getUser() method…
Maybe someone can help shed some light on this matter, as after a lot of times I couldn’t find a solution…
Thanks!
You are using facebook PHP SDK right.
In facebook php sdk when you call the
$facebook->getUser() method it first check it it’s private variable if user already set or not here is the method
so if you are call the first time of-course
uservariable isnullso now it call getUserFromAvailableData(); method
and the
getSignedRequestCookieName()returnso now
getSignedRequest()function first check whether signed request is set or not if not set it get signed request from Cookieso if finally if you not want to get previous userid just delete cookie named
''fbsr_'+YourApplicationID'