FBConnect not loading cookies on .aspx page

Jul 13, 2010 at 1:44 PM

Hi,

Great work on the library.  Super useful.  I managed to get it working but i am having a weird issue that i think is more related to FB's Javascript AUTH methods but i was hoping you could help me.

The JS that i use to connect to FB is the new version and looks like this:

<div id="fb-root">
    </div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: 'MYAPPIDGOHERE', status: true, cookie: true,
                 xfbml: true});
      };
      (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>

 



This works exactly as expected when i load it into a plain .htm file.

However when i put it in my .aspx file (Which is technically a Content Form in a MAster Page) the session cookies to handle auth don't work.  But if i navigate to my FBTest.htm page with a basic login control and this same code (taken from when i created my app - they give you sample code) the cookies load fine - then i can go BACK to the .aspx page and execute your auth methods normally.

I have tried moving this code out of the server side form - thinking that may be the issue, i have moved it into the master page, all over the place.  Bottom line is it's just NOT loading the cookies from an .aspx content page.  Any ideas why this may occur ?  i am using FireBug and the cookie add-on to verify this.  And the code is EXACTLY the same on both the html and aspx pages.

TIA,

MCM

Coordinator
Jul 24, 2010 at 7:20 PM
Edited Jul 24, 2010 at 7:21 PM

Hey,

Thanks for the kind words. Your issue is interesting. Do you happen to have a public url that I can take a look at?

Adam