quano
quano

Reputation: 19112

Facebook PHP Example not working

I'm using the latest php facebook sdk which can be downloaded here

In example.php, the only thing I've changed is the app id and app secret to my own.

So when I click "Login with facebook", I do indeed get redirected to facebook, where I need to login and allow the app etc, but when I come back to my page, I'm still not logged in.

No exception is thrown or caught. It just says "You are not Connected".

Clicking "Login with facebook" again gives same result.

What am I doing wrong here?

Upvotes: 0

Views: 725

Answers (1)

quano
quano

Reputation: 19112

I think the full url to the php script must be entered in the facebook ui. In my case it wasn't.

Also, it turned out I was getting the message "CSRF state token does not match one provided" in the error log, because our sessions didn't work. This was because we went from apache to lighttpd some time ago, and needed to chown the sessions directiory so lighty could write to it.

Find out what path php uses for sessions by doing phpinfo(), and chown that to your server.

Upvotes: 1

Related Questions