shlomi
shlomi

Reputation: 1

How to use Connect with Facebook?

I'm using HTML and JavaScript & jQuery.

I want to do connect with Facebook to MY WEBSITE (not to facebook website):

<html> 
 <head>
      .......
 </head> 
<body> 
 <div> 
  <div id="fb-root">
 </div>
  <fb:login-button perms="email,publish_stream,read_stream"
   autologoutlink="true">
  </fb:login-button> 
 </div> 
</body>

When I Logout, it signs out from Facebook.com as well, not just from my website.

Why is this, and how can this be fixed?

Upvotes: 0

Views: 410

Answers (2)

mjs
mjs

Reputation: 657

You need to check how are you handling the FB logout on your site. Currently the Logout mechanism of your site is calling FB to logout.

Please note here that in case you have logged in facebook from your website only it is advisable to logout from Fb when you logout from your site.

Upvotes: 0

pravi&#39;s
pravi&#39;s

Reputation: 11

I think this will help you to solve your problem. Facebook itself provide Facebook connect.This helps you sign-in by using Facebook as your login system.As long as the user is signed into Facebook, they are automatically signed into your site as well.But I think you need to register your site with Facebook. The code sample is below:

 <html>
<head>
  <title>My Facebook Login Page</title>
</head>
<body>
  <div id="fb-root"></div>
  <script src="http://connect.facebook.net/en_US/all.js"></script>
  <script>
     FB.init({ 
        appId:'YOUR_APP_ID', cookie:true, 
        status:true, xfbml:true 
     });
  </script>
</body>

Here you can find the code to Connect Facebook to your Website.

Upvotes: 1

Related Questions