This project is read-only.

Newbie help!

Sep 25, 2007 at 11:00 AM
Edited Sep 25, 2007 at 5:52 PM
Session not getting propertly initialized (fbApplication.IsSessionCreated == false). though I am logged in to Facebook. I am debugging through localhost. Here are the steps I have done so far.

1. Created the app in Facebook 'Glenn Test'. Set the urls to http://localhost:50000/SampleApp/IFrame. Set to use IFrame
2. Updated the app name (in both config and default.aspx), apikey and secret.
3. Set the web app to not use dynamic ports (50000)
4. Set the web app to wait for the first request.
5. Run the app in debug mode.
6. Login to facebook and then go to

If I put a break point and then go the app ( then I do get the request via the iframe. If I step through the code, the session is not getting properly created in FaceBookApplication.

Any help is greatly appreciated.
Sep 26, 2007 at 6:43 AM
Since you have breakpoints added, what is happening when you step through the code instead of properly creating the session object?
Sep 26, 2007 at 8:01 AM
AArgh, I just hit the wrong button and lost 20 minutes of typing (it went back to the previous page)

Shortened version...

1. Request and Form dictionaries have no values. As a result code steps through FaceBookApplication.OnInit, OnPageInitComplete() and all the base methods and FaceBookApplication.isAppAdded, FaceBookApplication.inCanvasPage, FaceBookApplication._inIFramePage, IFrameSession.sessionKey, IFrameSession.userID, IFrameSession.sessionExpries are null

2. FaceBookApplication.redirectUrl is set to ""
Config for the app "GlennTest" was retrieved and Api Key and Secret are initialized propertly.

Sep 27, 2007 at 5:50 AM
Unless I am completely missing something... if Facebook isn't passing any information in the request, i.e. if the Form collection is truly empty as you say it is, then I don't think the Framework can do anything but redirect you... do you see anything else the framework could do?

Now the question is why is the Form collection empty - something is causing Facebook to not send any information, which is unexpected. Are you sure the app has been registered correctly - all the canvas/callback URLs etc? I know Facebook's app registration isn't the most straightforward thing.
Nov 14, 2007 at 2:29 AM
Hi NikhilK,

Your sample application always returns fbApplication.IsSessionCreated == false, even after I am logged in Facebook!
What do I do wrong?

private void Page_Load() {
if (fbApplication.IsSessionCreated == false) {

User user = fbApplication.Service.Users.GetUser(null, "name");
if (user != null) {
greetingLabel.Text = "Hello " + user.Name;