Session key invalid - but only on FBML version

Nov 25, 2008 at 4:08 AM
Edited Nov 25, 2008 at 4:26 AM
Hi guys,

I'm giving a demo at Edmonton Code Camp next week on Facebook development with .NET and having problems with some samples. I'm using the starter kit (from Steve Trefethen) but it doesn't matter, I can recreate this without the kit.

I have two apps (one FBML, one IFrame) using the 2.0 version of the toolkit. Both are exactly the same except the FBML inherits from CanvasFBMLMasterPage while the IFrame inherits from the IFrame version (the FBLM master page is also stripped down of it's html).

When I run the FBML version I get a session key invalid - facebook exception when it tries to execute this line in the content page:

FriendList1.Friends = Master.API.friends.getUserObjects();

(this is in the Page_Load method)

The IFrame version works fine.

I'm running this locally from my Windows 2008 server box (which I've had problems with FBML before). I can put the files up on a 2003 server to run them and they might work (haven't tried that yet) but really want to run locally with both flavours for the demo. Like I said, the IFrame works fine. Just can't get FBML to work.

Any thoughts or suggestions would be appreciated. Thanks!

Update: I just uploaded my fbml version to my Windows 2003 server and get the same problem (as a yellow screen of death). You can visit it here if you like:

(the above link just gives you a 500 error from Facebook)

This link is straight to the app and should give you a yellow screen of death:

Nov 26, 2008 at 11:08 AM
I'm still new to FB development, so take any of this with a grain of salt :)

It does not seem like you are setting RequireLogin in you Pre_Init event. Try adding the following:

protected void Page_PreInit(object sender, EventArgs e)
        base.RequireLogin = true;