0

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.

4

1 回答 1

0

在第 3 部分,您可以使用 getLogoutURL() 中的下一个参数指定在注销时将用户发送到的 URL,它只是默认为 facebook。无论哪种方式,它所做的只是让您退出 Facebook,如果您指定下一个,则在后台,或者如果没有,则在前台,这不会阻止您的应用程序访问您的详细信息(不正确?)除此之外我无能为力,因为我自己网站已暂停 2 周,因为我无法解决注销问题,第一次访问后,它总是设法获取用户 ID 并报告用户详细信息,即使没有登录 FB。

于 2013-11-29T17:12:04.473 回答