No Facebook Connect Cookies for Localhost Development
January 20th, 2010While doing some Facebook Connect development, I found that the expected cookies were not being set when developing on localhost. To fix the problem, I added localhost.local to my hosts file (pointing at 127.0.0.1) and changed the settings for my Facebook application to use localhost.local as the base domain.


March 2nd, 2010 at 2:27 am
Wow that saved me going insane (pity about the last four hours).
Thanks heaps!
March 5th, 2010 at 7:13 am
Great Idea!! It works for me. Thank you!
March 18th, 2010 at 11:43 am
Worked for me too… don’t know why, this is a very strange bug
For the record you add it to your hosts file by (on linux) adding this to the beginning of your /etc/hosts file:
127.0.0.1 localhost.localhost
April 19th, 2010 at 3:38 pm
Thank you so much. I can’t express how much frustration this was causing me. Thank you.
July 1st, 2010 at 8:05 pm
THANK YOU!!!!!THANK YOU!!!!!THANK YOU!!!!!THANK YOU!!!!! this just finally concluded a full 8 hours of “why why why”…i could not get Facebook to connect in any browsers but safari…THANK YOU AGAIN
July 16th, 2010 at 9:05 pm
Life saver. Unbelievable that this was all it took! Thank you!
July 19th, 2010 at 5:08 pm
Thank-you! I’ve spend over a week trying to figure out why the Facebook APIs were not saving the auth cookie.
Here is what I did to get it working: 1) Add “127.0.0.1 localhost.local” to my host file
2) Updated my FB application Connect settings to use “http://localhost.local/” URL and “localhost.local” domain.
3) Create an IIS Web site on port 80 with the name “localhost.local”. – I had to stop my default web site, which is also on port 80
4) Update my Visual Studio 2010 web application to use IIS with the “http://localhost.local/” url.
HTH