0
votes

2 years ago I set up a website with facebook login and everything worked OK. Yesterday, I started working on a new project and I encountered the following problems. I use the latest version of SDK, and the server uses PHP 5.3.16 and is hosted on iPage.

  1. The login doesn't work. After I grant access to the app, getUser() always returns 0.
  2. When I login using Javascript SDK (which works), api(/me) returns nothing, but api(/user_id) works.
  3. Logout link doesn't work and redirects me t facebook homepage without logging out of my app.

I used the example file on PHP SDK, so I'm sure nothing's wrong with the code. Therefore, there must be something wrong with my server, or the SDK itself. I read tens of threads on StackOverflow and other websites, but couldn't find any fix. Since there are thousands of websites running FB PHP SDK without a problem, I am confused what I am doing wrong. I'd appreciate any help.

1
Some fixed suggest manipulating access tokens, but FB explicitly says that when using OAuth, access token are taken care of by the SDK and you do not need to do anything about them. - friendq

1 Answers

0
votes

on part 3, you can specify the URL to send the user to on logout, using the next parameter in getLogoutURL(), it just defaults to facebook. either way, all it does is log you out of facebook,be it in the background if you specified next, or foreground if not, which wont stop your app accessing your details(incorrectly?) beyond that i can't help because my own website has been on hold for 2 weeks, because i can't solve the logout issue, after the first visit, it always manages to get a user ID and report users details, even when not logged into FB.