FOSFacebookBundle: “The Facebook user could not be retrieved from the session.” (a possible solution)


If you get the message below when you try to connect to your site via Facebook Connect,

The Facebook user could not be retrieved from the session.

You just need to change your localhost URL on your own hosts file that Facebook can give you cookie permission of which is blocked by default for localhost development.
To do that, just add a new line below to your hosts file;
127.0.0.1 localhost.local
And do not forget to change your application settings at developer.facebook.com to allow your new application URL http://localhost.local/your_app/.

Thank you for reading.

  1. No comments yet.

You must be logged in to post a comment.