Facebook is the world’s largest social network with more than 2 billion monthly active users. There are so many users because it is a convenient way for people to connect with friends. The login process is smooth and simple, which makes it very easy for users to sign up and log in.
That’s why different websites such as blogs, news outlets, businesses, organizations, etc. have been integrating Facebook Login into their website by using Facebook Login API. There are more than 500 million people who log into their apps or websites using the same credentials they use on Facebook. It just makes things easier for them and more importantly, it helps businesses build trust among their users by giving them the option to sign in via their existing Facebook account.
Never miss an update from us. Join 10,000+ marketers and leaders.
If you are doing a migration from v2.2.x to v3.0.0
You Need To Do the Following Changes.
- Download SDK: https://github.com/facebook/facebook-php-sdk
- Keep the two classes base_facebook.php and facebook.php with the certificate fb_ca_chain_bundle.crt
- Include facebook.php in your PHP file.
- If you’re currently using the PHP SDK (v2.2.x) for authentication, you will recall that the login code looked like this:
include_once("facebook.php"); OR include_once("base_facebook.php"); $facebook = new Facebook(…); $session = $facebook->getSession(); if ($session) { // proceed knowing you have a valid user session } else { // proceed knowing you require user login and/or authentication }
- The login code is now:
include_once("facebook.php"); $facebook = new Facebook(…); $user = $facebook->getUser(); if ($user) { // proceed knowing you have a logged in user who's authenticated } else { // proceed knowing you require user login and/or authentication }
I hope you like this post and if you want to get such type of updates then please subscribe to our email. You can also visit our PHP/CakePHP portfolio page to see all our apps developed on PHP or CakePHP platform.