Always the same Session ? (Iframe app)

Oct 26, 2010 at 3:43 PM
Edited Oct 26, 2010 at 3:44 PM

Hello,

I hope that someone will help me on this.

1. Base.Master
I have a MasterPage with public partial class View_MasterPages_Base : Facebook.Web.CanvasIFrameMasterPage
this.RequireLogin = true; on the page_load
and the client side
        FB_RequireFeatures(["XFBML"], function () {
            FB_RequireFeatures(["XFBML"], function () {                FB.Facebook.init("<%= FacebookApi %>", "/xd_receiver.htm");            }); }

2. Default.Master
I have a "sub master" wich uses the Base.Master as MasterPage

3. Default.aspx
I have a default.aspx page which uses the default.aspx page

4. I load the controls i need

5. One of them includes

<Facebook:CanvasIFrameLoginControl     RequiredPermissions="email"    runat="server" ID="fbLoginControl"     RequireLogin="true"    />

6. The problem

I load the Facebook Api in the user control (not necessary the one with the CanvasIFrameLoginControl).
        var Api = ((Facebook.Web.CanvasIFrameMasterPage)this.Page.Master.Master).Api;

When i developped the application, everything was great. But now, i'm testing the app with an other facebook account and the Api.Users.GetInfo().uid is always the same.

In fact, if i use the application, whatever is the logging account, the api always return the same user.

I was wondering if i had a cookie problem, so i used tryied with Internet Explorer instead of Google Chrome. It's still the same user that Api.Users.GetInfo return. Api.Session etc. too.

 

Any help, any idea could help me.

Thank you very very much.

 

(p.s. with Safari and only with safari , i am redirected on the home page of the app!)

Oct 26, 2010 at 4:14 PM

Still looking for a solution...

I've test something in the MasterPage:

public partial class View_MasterPages_Base : Facebook.Web.CanvasIFrameMasterPage

{    

protected void Page_Load(object sender, EventArgs e)    

{

         this.RequireLogin = true;

         Facebook.Session.IFrameCanvasSession FBSession = new Facebook.Session.IFrameCanvasSession(FacebookApi, FacebookSecret);

         Facebook.Rest.Api api = new Facebook.Rest.Api(FBSession);

         Trace(api.Users.GetLoggedInUser().ToString());

}

}

//The trace display MY user UID (developper) which is NOT the USER REALLY LOGGED IN !

I don't know if this is the same problem but i've found this:http://www.devcomments.com/New-Post-A-session-key-is-required-for-calling-this-method-to153889.htm

and this : http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=83428

Oct 27, 2010 at 5:25 AM

There may be an issue with the new Facebook authentication and this SDK. If you are starting a new app you may want to check out the new Facebook C# SDK at http://facebooksdk.codeplex.com or at http://microsoft.com/facebook/

Oct 27, 2010 at 9:33 AM

Thanks ntotten.

Before starting the new app, i've looked at your project. It seems great (it's up to date) but i prefer the toolkit because it's easier to use for me. Maybe next time!
For the things not in the toolkit (family?), i use a simple FQL request.

My problem here was on the client side auth and (quotes for the xd_receiver). It's working great now.

Oct 27, 2010 at 1:08 PM

Just out of curiosity what features would you like to see in the C# SDK that would make it easier to use? We are always trying to improve. Thanks!

Oct 27, 2010 at 2:25 PM

In the toolkit i like the strong typed properties but i think that you choose to not use its in order to be up to date even if Facebook change their Api.