Question

How I can determine that user is logged in to facebook but not authenticated my facebook web application using php sdk. I know we have $user = $facebook->getUser(); but this only check that user authenticated the app or not. I want something like FB.getLoginStatus

  1. the user is logged into Facebook and has authenticated your application (connected)
  2. the user is logged into Facebook but has not authenticated your application (not_authorized)
  3. the user is not logged into Facebook at this time and so we don't know if they've authenticated your application or not (unknown)

Want to determine second condition using php sdk i.e. of not_authorized but logged in to facebook

Was it helpful?

Solution

The PHP SDK on it’s own has no way of knowing that.

The JS SDK can make cross-domain calls to have Facebook check if there is an active session under their domain. From server-side alone there is no way of doing something similar.

I want something like FB.getLoginStatus

And why not use just that, and pass the info on to the server? (Cookie, AJAX, …)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top