views:

275

answers:

0

I spent an entire Saturday exhausting Google. Serious good Karma belongs to anyone who can help.

I'm using the .NET Facebook toolkit V3 to authenticate my users against Facebook. When a user grants the offline_access permission I store the session key. When they return later without a facebook session (but with a valid session for my web app).

I grab the key from the database and I apply it to the Facebook.Session like so:

    facebookAPI.Session.SessionKey = offlineAccesSessionKey;
    facebookAPI.Session.UserId = (long)fuid;

Works like magic.

Now here's the problem:

How do I use this infinite session key with the Javascript API and FBML?

I can pass the session key to the client side, but then what? getAuth? set_session? Can't make it work, try as I may, and not sure it'd help me with the FBML.

I've tried this:

    facebookAPI.Auth.Session.UserId = (long)fuid;
    facebookAPI.Auth.Session.SessionKey = offlineAccesSessionKey;
    facebookAPI.Auth.Session.SessionSecret = _facebookAPI.Session.SessionSecret;
    facebookAPI.Auth.PromoteSession();

Hoping that it would copy the cookies, and I could pick them up on the client side, but no luck.

It seems like it must be a pretty common situation, but my "expert" Google skills are turning up ZERO.

Does anyone have any experience that can help?