Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Facebook Connect work with ASP.Net MVC

I am trying to integrate my ASP.Net MVC site with Facebook Connect.

For some odd reason after the login popup loads and connets, HttpContxt.Current.Requet.Cookies[Session_Key_Cookie_Name] still returns NULL!

What could be the possible reason?

Thanks

P.S

I also noticed that although I've set localhost/xd_receiver in the Site.Master FB.init call, xd_receiverController.cs doesn't get called (Set a breakpoint in it)

( I followed all those posts/articles when buiding my site: http://devtacular.com/articles/bkonrad/how-to-retrieve-user-data-from-facebook-connect-in-aspnet/ , Facebook Connect and ASP.NET, http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=45825, http://my6solutions.com/post/2009/04/05/Integration-of-Facebook-Connect-on-ASP-NET-MVC.aspx)

like image 416
Wineshtain Avatar asked Oct 27 '22 02:10

Wineshtain


1 Answers

Found a solution, hopefully this will save people the days I have burned trying to use ASP.Net and Facebook Connect.

The issue is simple:

The connect url property in your facebook application settings page MUST be your domain name AND the xd_receiver path in the FB.init is the relative path from the page your connect button is on!

otherways it wont save the session cookie in the right place.

Goodluck

like image 108
Wineshtain Avatar answered Oct 29 '22 16:10

Wineshtain