invalid session id

Mar 15, 2010 at 2:07 PM


I am new to this Facebook toolkit. I am trying to use offline_access extended permission to get list of users' friends but I always get 'invalid session id' exception message when I try to use stored session key & session secret.

here is the code i am using. hope someone can tell me what I am doing wrong. I get error in the last line of the method when I try to check permission status.

Note that I am trying to build desktop application.

private void button1_Click(object sender, EventArgs e)
     List<Facebook.Schema.Enums.ExtendedPermissions> aa = new List<Enums.ExtendedPermissions>();

     if (string.IsNullOrEmpty(sessionKey))
         session = new DesktopSession(appkey, false,aa);
         // initially i am simply displaying these info and storing it
         textBox1.AppendText("....uid '" + session.UserId + "' session key:" + session.SessionKey + " sec:" + session.SessionSecret + " exp " + session.SessionExpires);
         // use stored sessionKey & sessionSecret
         session = new DesktopSession(appkey, sessionKey, sessionSecret);
         session.UserId = userid;
Api api = new Api(session); textBox1.AppendText("....authen '" +api.AuthToken); bool hasoffacces=api.Users.HasAppPermission(Facebook.Schema.Enums.ExtendedPermissions.offline_access);