This is the first time I've tried working with Facebook. I spent a lot of my time at work a couple days ago, trying to get it all to work. It looked like everything was in order according to all of the examples in the Facebook documentation, but it just wouldn't work. The files are hosted on a site, so I'm not trying to work from localhost or anything like that, I have the app's site settings correct on facebook.
When I went home that night, I decided to work on it a little bit more and when I fired up the site, it worked exactly like it was supposed to. I figured it must have taken awhile to get the app settings to take affect and whatnot and just continued working on it all night. Made a bunch of progress and called it a night.
Next day at work. I open up my web browser, head out to the site to check out my awesome progress again, doesn't work. Remote desktop into home computers, works fine. Worked fine in IE, firefox, and chrome on my wife's windows computer, and worked fine in firefox and chrome on my linux desktop. At work, it doesn't work on IE, firefox, or chrome. None of this should matter because I'm not doing any of it on client side.
I've tried deauthorizing the app and it sends me to the authorize page, where I accept, but then it just returns 0 as the user. I can't figure out why this wouldn't just work the same, it's all server side and I'm just trying to echo the user at this point.
EDIT: Also, deauthorizing and reauthorizing works fine at home.
EDIT2: Here is the simple code.
<?php
require 'facebook.php'; //sdk
$facebook = new Facebook(array(
'appId' => 'yep',
'secret' => 'yep'
));
try {
$uid = $facebook->getUser();
$fbme = $facebook->api('/me');
} catch (FacebookApiException $e) {
print_r($e);
}
?>
It results in this error message, even after deauthorizing and reauthorizing the app and permissions. "An active access token must be used to query information about the current user."