Code for cookie handling from FB documentation not working
there's a code sample in FB's documentation for retrieving the user's cookie here. It's the last code sample right at the bottom of that page:
The JavaScript SDK saves the details for the logged in user in a cookie named fbs_YOUR_APP_ID. The following PHP example开发者_开发百科 shows you how to use access this cookie and then customize the generated page based on this information: [...]
When I simply copy that code into a new file and fill in my app ID and my app secret, I receive the following error message:
Warning: file_get_contents(https://graph.facebook.com/me?access_token=) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in [...] at line 26
Line 26 would be the last line of the following three lines:
$user = json_decode(file_get_contents(
'https://graph.facebook.com/me?access_token=' .
$cookie['access_token']));
I'm a little lost right know. Any ideas?!
精彩评论