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

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

2 0
4 followers
Viewed: 9 152 times
Version: 1.1
Category: Tips
Written by: sirin k
Last updated by: Maurizio Domba Cerin
Created on: Sep 1, 2012
Last updated: 11 months ago
Update Article

Revisions

View all history

Related Articles