Facebook Login: Javascript and PHP Example - facebook

I was hoping that someone had a current example of using the Facebook Javascript SDK to login and then using te PHP SDK to handle the session the rest of the time.
I've been Googling and trawling the web for an accurate, working example but they all seem to have some limitations or bugs.
I'm finding that after logging in with JS, the PHP seems to fail to find the session more often than not. I can see a FBRS cookie has been set and is always active but this doesn't seem to help.
Really tearing my hair out with this one...
Cheers

Seems like all my problems with the sessions were because of this bug: developers.facebook.com/bugs/404450666302585
I've updated to the latest PHP-SDK version and everthing seems to be alright.

Related

Facebook Logoff Not Working

I am trying to build a Facebook/Twitter application that allows the user to take a picture at a trade show for example. Then enter their facebook or twitter credentials and a comment and have it post to there site. I have messed around with the facebook side of things and can get it to work but logging the user out doesn't work as I thought.
The cookies are stored in Safari, this is fine but of course my app cannot get them.
Each time the user is done posting it needs to correctly log them off so the next user doesn't just relog back in as the prior user because of the cookies in safari. This almost needs to be a Kiosk like app.
I have been looking at this topic for about a week and all the old examples are relevant to the old FacebookSDK. I have looked at the examples provided by Facebook to no avail. Any help or pointers would be GREATLY appreciated. I
UPDATE:
I was looking into something like UIWebView to display facebook and then the cookies would be available to be deleted... Has anyone done this recently? I found some old examples but they do not work.
Update: I might have this working I am stuck on something else now but will post the answer to this question as soon as I finish! Should be next day or so.

Is WWW::Facebook::API going to stop working?

I recently came upon some old code which I didn't write. It uses WWW::Facebook::API to login via Facebook to our website. It currently only calls WWW::Facebook::API::Users to get the user's info.
Now, my doubt is if I have to update this code to support the new OAuth 2.0 method or the newer Facebook Graph. According to this, the legacy Auth method is going to stop working on September. However, I don't know if WWW::Facebook::API uses this method. As far as I can tell, it does not pass any user's information to the browser, as it does server-to-server authentication. Has anybody dealt with this before?
I have been using this CPAN module and it is still working so I would answer my question. WWW::Facebook::API does not seem to have stopped working.

Is there a decent PHP Facebook Connect example anywhere online?

I have a very simple php site that I'm wanting to add facebook connect to. I have searched to and fro to find out how to do this. Even the developer docs at facebook are apparently wrong. I see many seasoned programmers replying that the docs are outdated and some of the methods won't work.. how one should create a new solution for this part, etc...
I know that Facebook changed a lot about the way facebook connect just before 2011. Isn't there someone out there who could provide a working example on how it's done? I will give my left leg to someone that could provide an updated and working tutorial.
Thanks.
The PHP Example shows you exactly how to do this. Short, redirect to $facebook->getLoginUrl() and then call $facebook->getUser().

Facebook Application Redirect Loop after authentication

I've encountered this problem while using the facebook c# sdk v4.2.1:
After allowing the app, a user using a IE browser without flash being installed will go on a infinite redirect authentication loop.
At first i thought it was a cookie problem , until i tested on another computer and realised that both of the computers had no flash installed.
Has anyone encountered this problem before? I know for sure i've encountered alot of problems that using the official facebook javascript sdk to authenticate users on IE without flash.
I would appreciate if anyone found a solution to this problem can answer this question.
Would you please edit you Facebook settings on Facebook i had the same problem before and i edit the settings on the advanced tap and it works :)
https://www.facebook.com/developers/apps.php?app_id=app_id
hope that works .
I just had this problem when reviving an older facebook app. I fixed it by enabling "signed_request for Canvas" in the Advanced settings tab on for the app on facebook.
Flash shouldn't be the problem. Did you install the Facebook handler in your web.config?
Also it sounds like you aren't being properly authenticated. You might want to sniff with something like Fiddler and see what is happening.

Blank popup with FB connect

I've implemented the facebook connect using Javascript SDK. The authentication works fine when the user I'm trying to authenticate is not logged into facebook. But when he's already logged into facebook the login popup never closes. The url of the popup starts with "http://static.ak.fbcdn.net/connect/xd_proxy.php#cb=....."
This happens both on Firefox 3.5 and on Chrome.
Any suggestions? Do I need to set any extra parameters while connecting to Facebook?
I've encountered the same error today, with my year old implementation. I've added the channelUrl tag to FB.Init(), without any luck; so I started the login procedure from scratch with the js sdk, oauth2 enabled: with some minor changes, everything started to work misteriously again. I've run my pages through the Facebook debug tool as well, it suggested some changes as well.
To sum up: basically, if Facebook Connect stops working, upgrade your code according to the latest documentation avaliable.
No special parameters are needed. This is probably a browser problem. Maybe you have a setting/plugin somewhere that does not allow Javascript to close a window for you.
The easiest way to test this is to post a link to your implementation so that other people (with other browser setups) can give it a try.