Facebook Logout Button for My Website (Not Facebook Connect Logout) - facebook

I was wondering if it is possible to create a "logout" button for my site that will log a user out of facebook and then redirect them to a specific URL ? Let me elaborate, I work in a retail store and I have a mounted iPad so customers can "like" our facebook page (by using a traditional facebook like button). Currently, when customer's select "like" it opens a new window where facebook asks for a username and password, and then immediately after the customer hits "Submit" it re-directs them back to a specific URL where I say "thanks for liking us"...the only problem is that it keeps them logged into facebook.
I'm hoping to put a logout button on my "thank you for liking us" URL so they can click that to logout (without going back to facebook) and then it re-directs back to the page with the like button for the next customer.
I have tried facebook connect but it's so many steps because users have to allow the app etc. that I'm hoping to avoid that. Maybe a way that clears the facebook cookies or anything else? I'm so out of ideas that anything will help!

Include the Facebook JS SDK and then call FB.logout() either on click of the link, or on the thank you page.

Tested, not working even with FB.logout(), because once you logged in facebook.com, then fb cookie will be injected automatically, there's no way to remove it unless you've logout from facebook.com.:/

Related

Facebook FB.login popup opens invalid URL

In my website i am using FB Javascript SDK for providing my users to login with their FaceBook account instead of filling up register form.
The problem is from today morning, when i click on the "Signin with Facebook" button, it opens popup with the URL
https://www./login.php?skip_api_login=1
instead of https://www.facebook.com/login.php which is not a valid url.
why the URL is comming like this ?
I am having the same issue (I would just post a comment but apparently you need 50 rep) so this is not a complete answer. To provide more info it seems it may be a temporary bug, if the user you've been logging in as is currently logged into facebook, the user is logged in straight away. If the user isn't, this loggin error occurs. Obviously once it perceives it that way, you can't go back to a new user because it skips the loggin screen. Perhaps facebook is expecting that user to be logged in which leads to this errornous way of dealing with it.

after my visitors log in using Facebook connect, they need to log again when clicking on a like button

I'm developping a contest for my website.
http://www.abcroisiere.com?jeu=1
People can subscrire using Facebook connect. At the last page of the contest you can click on a like button.
But the visitor has to log in again in Facebook for that. Is it normal ? Is there something I'm missing ?
regards,
If the user was logged out of Facebook, goes to your site, and logs in to Facebook via the Login button on your site, the Like button won't be aware of that, so will still think the user needs to log in before they can complete the Like action
If this edge case is important to your app; refresh or replace the Like button after the user logs in. When it refreshes it will be aware of the user's login and won't prompt the login dialog if the user clicks it

How does a Website with Facebook login work practically?

If I create an app for my wesite under the tab 'website with Facebook login' - how does this work for users accessing my site?
Do users HAVE to sign in with Facebook to view my site?
Or would they only be prompted to sign in if they were not signed in and they clicked my Like or Send buttons (the only button's we'll have)?
If a user doesn't click the like or send - will they be affected?
As much details about the user experience as possible wouldbe great. Cheers all!
Facebook login is usually just a wrapper on top of your website that allows you to get Facebook user details if they use Facebook. You will still need a system to track who is actually logged in to your site and they will still have to click the "Login with Facebook" button.
On the other hand, the Like and Share buttons are independent as they simply send your website data to Facebook and Facebook does not send anything back to you.
You do not need Facebook login functionality to put Like or Share features on your page.

facebook logout without sdk

How can I log out user from facebook without authorizing him myself?
I have a public IPad which people come to, authorize in my application and do stuff.
One of the links leads to m.facebook.com/sharer.php?u=..
When the user presses it, he is redirected to facebook, which asks for his login/pass and makes the share.
Later then the user press Logout on my site
I need to log out him from facebook some way,
so the next user who will use the ipad and press share will post to his wall and not to the first user's .
Same happens when i provide the iframe version of the Like button.
The first user logs in to facebook, makes the like, logs out of my web site,
and the next user see the like button pressed.
Thanks in advance ;)
I've just done some work with facebook recently on one of my projects and I used to visit a url to log them out it was something like
http://www.facebook.com/logout.php?redirect=your_url
It may not exactly be that as its off the top off my head but after visiting that the user got redirected to my site again logged out of facebook.
You may also have to provide a token.
Hope this helps!

Facebook Permissions Dialog in Page

I've created an app that works fine, however if the user has not authorized my app yet, they have to do the following (assuming they are in facebook AND logged in) -
go to my app
click login/authorize
popup with facebook permissions opens
accept in the popup
However I noticed with Zynga games like Mafia Wars 1/2, Farmville etc, when you go to the app, if it hasn't been authorized, it takes you straight to the permissions which is in a PAGE and not a popup, thereby eliminating one step. Also, the permissions dialog is full width, there is not app sidebar.
Does anyone know how I can duplicate this flow? It would be much easier to have users authorize within a facebook page rather than through a popup. How can I get permissions inside the page?
thanks in advance
Once user visit a Page tab with your application you can check if he is connected with your application by comparing Page ID with User ID in signed_requests, for unauthorized users ID's will be same. In that case you can start authentication flow by redirecting user's browser to "login url".
If you want it to be full page just do the redirect with JavaScript like this:
window.top.location = 'https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=COMA_SEPARATED_PERMISSIONS'
If you using PHP you can construct Login URL by calling Facebook->getLoginUrl method.
Read the docs on Facebook authentication