Facebook logout problem - facebook

I am using Facebook Login button in my website.
Visitors can log in via facebook successfully.
FB login is working integrated with my own membership.
I mean I keep logs of FB logins.
The problem is here;
User may log out from my site by clicking Logout button (my own logout button)
When they press the logout button, i redirect them to logout.php and run the following JS;
"FB.logout()"
The JS code causes that user logout from their facebook account not my site.
If they login facebook on an another tab, and refresh my page they will log in again.
How can i end a session that user open via Facebook on my site?

You also have to clear facebook sessions from your machine with below code:
using Facebook;
Thread.Sleep(1000); // delay is required to get it work
Facebook.Session.ConnectSession cn = new Facebook.Session.ConnectSession(ConfigurationManager.AppSettings["APIKey"].ToString(), ConfigurationManager.AppSettings["Secret"].ToString());
cn.Logout();

Related

Facebook Recent Logins breaks OAuth flow

I'm having troubles working with what appears to be an error with Facebook's OAuth server-side flow. When logging into Facebook using "Recent Logins", Facebook does not redirect back to my calling application. Instead it goes directly to the Facebook home page.
If I login to Facebook using the email/password fields at the top right of the screen, then the redirection becomes successful.
Is there some way to force facebook to send users to it's main login page and not this main page that displays the recent logins when they are not already logged into Facebook?
This also occurs using Facebook's very own OAuth for developers. So I know it can't be just me.
Login to Facebook.com
Logout
Visit facebook's apps page
Click your profile pic and enter your password (rather than using the blue banner to login).
Facebook redirects you to their home page rather than this page
What would be great is a parameter to this page that would allow me to force a particular facebook login dialog as a workaround.

How to stop automatic facebook login in my website?

i have a site which has a facebook login button. if i am logged in facebook on same browser, and clicks on website login button, it redirects me to the profile page without asking option to login via facebook or via form. i will add google plus button also in future.
so please tell me how to stop this automatic login in facebook.
It's all about Browser Cookies and Cache.. The session already kept in your browser cache. so that's why .. It automatically redirects you to facebook. You need to clear your browser cache. to solve this issue...

Facebook comments plugin on html page not redirecting when user has to login to FB account

Have implemented Facebook comments plugin. If a user is not signed into a Facebook account, after clicking the Comment button and loggin in to their account nothing happens unless the F5 key is pressed. Is this correct or do I need to do something.
When the Comment button is clicked the login screen says: Log in to use your Facebook account with . Then requests the login credentails.
I have added a login button which when pressed says "Log in to use your Facebook account with Comments." and then requests the login credentials.
This is an example of a page with the comments:
http://www.shahphoto.co.uk/wedding_photographers/wedding-photographer-cornwall-pervaiz-shah.html

Facebook Page update through external page

I'm new to Facebook App development and I got this Problem:
I've created a Facebook Page (so I'm the administrator). Now I would like to have an external Webpage with a simple textarea and a "send" button. So everybody who has the link to this page could update this Facebook Page even without a Facebook account. This status update should be send by my page administrator account.
I thought I could write an app and authorize this app to publish_streams on the page and after the authorization I could switch $fbuser = $facebook->getUser(); to $fbuser = IDOFMYACCOUNT.
So the fbuser would be always my account wich is allowed to post to the Page.
If I try to use this application with an other browser (wich isn't logged in to my fb account) I get this error: (#200) The user hasn't authorized the application to perform this action
So this is the way I thought I could solve my problem.
Do you guys have an idea how I (and other people who don't have a FB account or don't wan't to login or I don't want to add them to Facebook Page administrator) could update the Facebook Status of a Page from an external website?
You will need your token "baked in" to your code and some sort of admin back end to update the access token before it expires.
Also you need manage_pages permission and the token of the page if you want to post as the page.
This can be accessed from /me/accounts

Facebook connect silent logout along with my logout url?

I have created a facebook connect login script in addition to the custom login script my site uses, which records FB user id and stores in my DB. It uses facebbok.php scripts provided by facebook and JS based popup login dialog (oauth).
I just authenticate user from FB account and do my own cookie based login on the basis of matched fb user id.
Now the problem is I can get logout url from php using getLogoutUrl() but how to logout silently without changing url in address bar using my logout.php? I tried destroySession() but it didnt logout fb user.
If user dont logout using getLogoutUrl() then next time when some other loggedin FB user tries to use fbconnect login the FB dialog box gives error "An error occurred. Please try later". Then I have go back to IE and logout that FB user from there and it works.
You can't "silently" logout a user using Facebook API. What you can do is test if the user is logged using getLoginStatus