I’m a junior developer and I’m working on a website tying to integrate a Facebook login using the JavaScript SDK and PHP SDK that Facebook provides in Facebook developers . I was able to set up JavaScript SDK and uploaded the files for PHP SDK to my server for testing.
This is what I have so far: http://www.reyesmotion.com/kno_login/index.html
What I have works as after clicking “Log In” button I’m prompted to enter credentials to log in with Facebook or automatically logs me in if I’m already logged in on Facebook.
However, I need to be able to keep cookie and reuse it for various applications on the site I’m working on.
One of the steps for setting up PHP SDK is as fallow:
Use the SDK by instantiating a new Facebook object with, at a minimum, your App ID and App Secret:
require_once("facebook.php");
$config = array();
$config['appId'] = 'YOUR_APP_ID';
$config['secret'] = 'YOUR_APP_SECRET';
$facebook = new Facebook($config);
Here is the link for instructions from FB: https://developers.facebook.com/docs/reference/php/
Where and how do I initialize “Facebook object”, what file should contain this code? The instructions aren’t very clear to me.
If anyone can guide me on the right direction I would really appreciated.