Facebook connect redirection issue on singin

Facebook Developer continuously provides it’s greatest feature. Now-a-days the most sexy feature of facebook developer is facebook connect, anybody can use facebook connect on his site by which visitor can access few protected areas of his site using facebook login.

Popular websites like Mashable, Digg, CNN etc already implemented this feature. There is nice tutorial http://wiki.developers.facebook.com/index.php/Facebook_Connect_Tutorial1, by following this you can easily implement this feature on your site in five-ten minutes. But i faced a problem that is, when i click on connect button, sign in window comes, when i put correct info – it’s logged in successfully but the sign popup box doesn’t go away, instead my web site comes on the popup box. Finally i found my problem. See the code below:

<script type="text/javascript">  FB.init("3f0ba1d70537bbf9381bca2bbb9f9a93","xd_receiver.htm"); </script>

The second parameter is the filename provided by facebook. I’ve put my file on root folder which is accessible by http://www.mydomain.com/xd_receiver.htm but my facebook login code was on a page like http://www.mydomain.com/news/, so it tried to access that page by http://www.mydomain.com/news/xd_receiver.htm Later i’ve modified my code as below and the issue solved 🙂

<script type="text/javascript">  FB.init("3f0ba1d70537bbf9381bca2bbb9f9a93","http://www.mydomain.com/xd_receiver.htm"); </script>
Advertisements

5 thoughts on “Facebook connect redirection issue on singin

  1. Does this work for an EE site? We are an ee site (www.greatnonprofits.org) and looking to allow people to log in using FB. Does your instructions above enable anything posted on our site to get posted to that users’ FB?

    Thanks!
    Perla

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s