How to use Connect with Facebook?

advertisements

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?


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.