A session key is required for calling this method

Mar 30, 2010 at 8:44 PM

I keep receiving the above error in my iFrame App made using the Facebook SDK 3.01. My app works for me, but when I test it from another user's login, it does not work, throwing the above error. I tried many ways to set the SessionKey value. The following is my current MasterPage...

public partial class iFrameCanvas : Facebook.Web.CanvasIFrameMasterPage
    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            base.Api.Session.ApplicationKey = ConfigurationManager.AppSettings["ApiKey"].ToString();
            base.Api.Session.ApplicationSecret = ConfigurationManager.AppSettings["Secret"].ToString();
            base.Api.Session.SessionKey = Request.QueryString["fb_sig_session_key"].ToString();
            base.Api.Session.UserId = Convert.ToInt64(Request.QueryString["fb_sig_user"]);
            base.RequireLogin = true;



Earlier, I tried retrieving the SessionKey using cookies...

    public static string GetFacebookCookie(string name)
        if (HttpContext.Current == null)
            throw new ApplicationException("HttpContext cannot be null.");

        string fullName = ConfigurationManager.AppSettings["ApiKey"].ToString() + "_" + name;
        if (HttpContext.Current.Request.Cookies[fullName] == null)
            throw new ApplicationException("Could not find facebook cookie named " + fullName);

        return HttpContext.Current.Request.Cookies[fullName].Value;


If anyone has faced a similar problem and/or have a solution, please do reply. This is really frustrating.

Apr 3, 2010 at 8:21 AM

You should not need to do much other than RequireLogin = true.  Also, when linking to other pages within the same site...you want to append thefb_sig_session_key, UserID and Timeout to each link.  There are other posts around here with exact details on that.