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

3 followers

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 Nintriva Wireless

Be the first person to leave a comment

Please to leave your comment.

Write new article