Facebook Sdk Extension And Persistent Data

Hi folks,

I understand this might not be a very Yii-specific question, but I thought I would ask here anyway as it is regarding an extension and I usually find the forums here more helpful than others.

I am building a FB app using the PHP SDK extension for Yii. Everything is working fine in terms of the extension itself but I am having an issue where I require to hold persistent data in between MVC runs.

I am running this code in the controller: -




Yii::app()->facebook->signedRequest = Yii::app()->facebook->getSignedRequest();

Yii::app()->facebook->userIsAdmin = Yii::app()->facebook->signedRequest['page']['admin'];



Now, this works fine when the app is initialised for the first time through the Facebook page. However, when I run the same controller through the menu in the Yii MVC inside the iFrame, I have a problem where the extension now only see the profile data of the person visiting i.e. it runs the controller with the above code in it again and can no longer retrieve anything for


Yii::app()->facebook->getSignedRequest()

as it only sees the profile of the user when the controller is run.

So, my issue is I need some way of persisting the


Yii::app()->facebook->userIsAdmin

variable in between instances of the controller being run.

What would be the recommended way to do this? The only way I can think of to do this is using


Yii::app()->session['fbSdkUserIsAdmin']]

. I believe this would work but I would be interested to know if anyone has any recommendations as to how to handle this? Is there anyway to hold the information statically in the SFacebook class?

Again, I hope this isn’t off-topic and that 1 or more people can give me their input here. It would be greatly appreciated.

Regards,

U4EA