I am using the PHP library for the Graph API (http://github.com/facebook/php-sdk) but am a bit confused about how it is all working (or not).
I just want to authenticate the user and get the user ID back. What I really want to know is what to do once the user has logged in to Facebook and returned to my site. There is data called 'session' in the URL. Does this need to be stored in order to continually get the user ID? It is really not apparent, to me, from the samples or (lack of) documentation.
Also, would it be easier to just cut out the PHP library altogether and just handle the reponse myself, storing it in a session variable. If i were to do this, what is the best method of getting/extracting the current users ID?
Edit:
Currently, i have copied the facebook.php file and the example.php file over from GitHub, and only changed the application name and secret in example.php. It is not storing a cookie and is saying 'You are not connected'. However, when I print_r($session);
it works (but only if the url contains the session data).
Has anyone else experienced problems like this? Is it possible that running on localhost is causing this?
Edit:
I uploaded exactly the same two files to a host and it worked perfectly. It stored the cookie and showed all information it should. It is most likely that running on localhost is causing the problems. I have changed the settings under the Connect tab on the Facebook Developer application but still no luck.
Anyone know how to do this from localhost or what i am doing wrong?