Facebook Connect API Problem !!!

johnnygaddaar.cs58

New Member
Messages
21
Reaction score
1
Points
0
Hello Guyz,

First of all, I hope that I am posting this in the Right Section :tongue:

Actually, I am using Facebook Connect API in my Website so that people can also Login into my website through Facebook. I am using both Registration + Login system.

Everything is working fine. When User Logs In to My website using Facebook, it snatches user's details like username and hi/her profile photo etc and make his/her account.

But the Problem is that I am unable to Log them out.

Right Now, I am using a hidden IFRAME in the Logout Screen page which Loads a page containing script to Log Out user from Facebook.

But, It is not getting Logged Out.

Due to this, When a User Logs In after filling the Login Info of FB once and then Logs Out of Website, and then again click Login using FB button, this Time it doesn't ask for the Login Info and Logs In as the Same User.

It means anyone can Log In as that previous User account which hopefully no one wants.

Please if you know much about Facebook API, then Please help me to get a code for Logging Out of Facebook.

I am using this page as my IFRAME in LOGOUT SCREEN.

http://www.clan-icsl.com/fblogout.html

Code:
<html> 
<head> 
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> 
<script type="text/javascript"> 
 
function facebook_logout() {
 
         FB.Connect.logout(function() { FBCLogout() })
         function FBCLogout() {
             document.write('logged out');
         }
     }
     
</script> 
</head> 
<body onload="facebook_logout()"> 
</body> 
</html>


So Please tell me What CODE should I use with Facebook API to Log Out a User. I can't Find any solution on Facebook Developers Help. So I posted here.

Thank You
 

espfutbol98

New Member
Messages
200
Reaction score
2
Points
0
First off, I'm still quite new at all of the Facebook APIs and I even tried making a site using this method, but I gave up on it because I had more important things to do. Also, I understand the origanal Facebook documentation sucks and can even be contradictory.

I think it might be (1) missing the Facebook Javascript SDK or (2) your site might not be logging them out as well (depending on how you coded it). More in depth...

On that one specific page, I did not see the Javascript SDK:
http://github.com/facebook/connect-js/
Code:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/sr/all.js"></script>
<script>
  FB.init({
    appId  : 'YOUR APP ID',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
</script>
Try using the Firebug plugin in Firefox, this should show any errors in the Javascript. (Sorry the Mozilla site is in Serbian from this url because my computer is too. Try changing the "sr" to "en" in the url)

It could also be that your site requests them to login via Facebook, then Facebook sends you perameters that get turned into a Sesson. When they click the logout button, the Facebook session might be destroyed but not the one for only your site.

Also check out this file:
Code:
http://www.megaupload.com/?d=UVH7M25X


---------- Post added at 05:50 AM ---------- Previous post was at 05:44 AM ----------

Also, sometimes random things don't work in diffrent browsers (or at least on my computer). An example is when I go to a 3rd party "Like" site and I click the "Like" button, it doesn't do anything (when logged in) or I get a login window from Facebook that turns blank after logging in. This only happens in IE for me but not Firefox. This probably is not a factor but is still good to know.
 

johnnygaddaar.cs58

New Member
Messages
21
Reaction score
1
Points
0
Thanks for you Support !

I had to remove that API because people were saying that they are getting logged in with other profiles. :p

So I had to disable it.

Thanks for your Support ! Now I will work on this !!!!!
 
Top