Solution for session lose of Facebook iframe application in Internet Explorer .

You are viewing revision #2 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.

next (#3) »

Facebook iframe app’s session is losing in Internet Explorer when doing a second redirection inside the facebook iframe app.The main reason is ,by default IE wont allow cookies in its priavacy settings If cookies not available means session is also not available for our Facebook iframe app in IE.

solution:

We just need to pass a header like header(‘P3P: CP=”HONK”’); when a browser accessing our page.

In Yii we can set this header at the beginning of evry action or filter.

see the example in Yii,

public function actionAuthenticate()
    {
          header(‘P3P: CP=”HONK”’);
           /* Declaring facebook object for making facebook api calls */ 
           $facebook = new Facebook(array(
            ‘appId’  => Yii::app()->controller->module->app_id,
            ‘secret’ => Yii::app()->controller->module->app_secret,
            ‘cookie’ => false,
               ));
public function filterPermission($filterChain)
{
 header(‘P3P: CP=”HONK”’);

Without this header you are not able to use session when working with IE.

Regards,

sirin k

Yii developer