I'm using this example to use the Facebook Javascript SDK to login.
https://github.com/facebook/connect-js/blob/master/examples/jquery/login.html
Everything works fine in that I can login and it shows the profile picture in the div.
I then want to retrieve the cookie server-side and use it to make some requests of the Facebook API.
I added a debugger statement in my rails application, and then restarted the server in debug mode.
To simulate a simple request, I opened Firebug and did this:
> $.get( '/', {}, {} );
When I am inside the debugger I run these commands:
(rdb:1) p cookies
{}
(rdb:1) p request.cookies
{}
So, no cookies are set.
When I look inside Firebug, I don't see cookies set in the request headers.
Request Headersview source
Host tixfu.com
User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
X-Requested-With XMLHttpRequest
Referer http://tixfu.com/
Anyone have any idea what I am doing wrong?
If you want to hit the site, the site is tixfu.com
Thanks, Chris
The sample Facebook canvas application runwithfriends sets a cookie on the first POST request that Facebook sends to the app. Then, that cookie is sent to your server with every subsequent request that your iframe makes. Make sure you edit your application's advanced settings like those of runwithfriends.
I'm still wondering how to send the cookie (fbs_{app_id}) that the FB JS SDK sets to the server. Koala gets the Facebook JavaScript SDK cookie, so it must be possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With