how to check that user is logged in to facebook - php sdk
-
11-12-2019 - |
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
- the user is logged into Facebook and has authenticated your application (connected)
- the user is logged into Facebook but has not authenticated your application (not_authorized)
- 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
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