Session Invalid in new Facebook

Aug 28, 2008 at 12:57 PM
Edited Aug 28, 2008 at 12:58 PM


I am developing using the Facebook Toolkit 2.0 downloaded from CodePlex.
I am receiving a "Session key invalid or no longer valid"  on call  notifications.send(), getLoggedInUser(), getInfo() and many other methods
Also i receiving a "Session key invalid or no longer valid" when trying to run FBMLCanvasSample application.
This call returns the session error.

The app is an FBML app.
Can anyone provide insight into what the problem might be?

Aug 31, 2008 at 9:29 AM
any ideas ?
Sep 8, 2008 at 10:58 AM

I am receiving the same error in the following scenario.
Session values which we normally maintain at the server-side were not getting destroyed.
Suppose User A and User B are using the same machine.
Lets suppose that User A has logged into facebook using his account.
After sometime, say User A has logged out of facebook.
User B has logged into facebook using the same browser which User A has used previously.
User B is  seeing the records of User A.
Is there any possibility to determine whether the User A has logged out of facebook or lost scope of the application.
Can anyone shred light on this issue.

Sep 11, 2008 at 10:08 AM
I am having the same problem too.
I'm using a master page to handle the authorization by inheriting facebook.web.CanvasIFrameMasterPage.  As you can see I am using IFrames here.  I experience the problem when I log out as one user and back in as another, or if I uninstall the app, then reinstall it with the same user.  Also as a note, I am not inheriting the Page Base on my pages either.

I did try catching this error, and if it occured, manually initating the session, but this didn't work either.
Hopefully one of us can figure this out, or get some advice from a guru!

Sep 11, 2008 at 11:21 AM
My solution to changing users

  Protected Sub onMasterPageLoad(ByVal sender As Object, ByVal e As EventArgs) _
    Handles Me.Load
    If (Me.Page.Session("userID") Is Nothing)
      Me.Page.Session("userID") = Me.API.uid
      If Not(Me.Page.Session("userID") = Me.API.uid)
        Me.Page.Response.Redirect("/YourFacebookApp/Default.aspx", True)
      End If
    End If

  End Sub

Sep 22, 2008 at 2:14 PM
Hi.. it is nice idea mr.ensonix .But it doesn't work.When get the uid from API it only return you the old ID.It didn't change until you clear cookies. Because they provide infinite sessions or temporary sessions for one hour.They said it will clear after user signout of the facebook website.But i didnt.

Here are some reference on sessions and infinite sessions

Please help me who developed  facebook application

Oct 9, 2008 at 6:36 AM
Hey guys,

I believe your issue may be related to this one here:

If this helps, definitely go to the Facebook bug tracker and vote for them to fix this issue!