Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6389237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:22:43+00:00 2026-05-25T03:22:43+00:00

The code bellow works well with latest version of Chrome on Linux and Windows,

  • 0

The code bellow works well with latest version of Chrome on Linux and Windows, latest version of Firefox in Linux and Windows, all IE versions on Windows except IE9.

Unfortunately, it does not work as expected with IE9 in Windows and latest version of Chrome and Firefox on MacOS

I did a couple of test and I found that the error happens when redirecting from the Facebook application’s canvas page to another Facebook canvas application that uses an IFrame to show the first application. When redirection happens $user is null on the above mentioned browser on MacOS and IE on Windows but it is not null and working as expected for every browser mentioned in first paragraph.

Any suggestion?

<?php    
$user            =   null; //facebook user uid
try{
    include_once "src/facebook.php";
    include_once "src/fb_logger.php";
}
catch(Exception $o){
    echo '<pre>';
    print_r($o);
    echo '</pre>';
}
// Create our Application instance.
$facebook = new Facebook(array(
  'appId'  => $fbconfig['appid'],
  'secret' => $fbconfig['secret'],
  'cookie' => true,
));

//Facebook Authentication part
$user       = $facebook->getUser();

// We may or may not have this data based 
// on whether the user is logged in.
// If we have a $user id here, it means we know 
// the user is logged into
// Facebook, but we dont know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.

$loginUrl   = $facebook->getLoginUrl(
        array(
            'scope'         => 'user_status,publish_stream,user_photos'
        )
);

if ($user) {
  try {
    // Proceed knowing you have a logged in user who's authenticated.
    $user_profile = $facebook->api('/me');

            if(isset($_GET['iframe']) || isset($_GET['code']))) {
    }
    else {
    echo "<script type='text/javascript'>
        if(window.location.href.toLowerCase().indexOf('iframe') != -1 || window.location.href.toLowerCase().indexOf('oauth') != -1 || window.location.href.toLowerCase().indexOf('code') != -1) {
        }
        else
                            //opening new application with iframe to show the previous one
            window.open('link to the iframe pointing to the this application', '_parent', '');
        </script>";
        exit;
    }
  } catch (FacebookApiException $e) {
    //you should use error_log($e); instead of printing the info on browser
    //d($e);  // d is a debug function defined at the end of this file
    $user = null;
  }
}

if (!$user) {
    echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
    exit;
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:22:44+00:00Added an answer on May 25, 2026 at 3:22 am

    I think I found the solution

    I added:

    //required for IE in iframe FB environments if sessions are to work.
    header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    

    in my code and it’s now working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below works well in Safari but in Chrome and Firefox the form
The code below works great except the email has all the text on one
This code below works in all web browsers except IE: <input type="text" name="passwordLogin" value="Password"
Code below works well on Firefox - displays progress bar which progresses on every
Currently i'm using below code which works well. $(#topperAtBaseLevel:visible, #lowerAtBaseLevel:visible, #midAtBaseLevel).hide(); any optimised code?
The code below works in FF, Safari, Chrome. But IE is giving me issues.
My code is below and works perfectly well when called from onCreate() I have
i can't understand why this code works well but the code below no. <!DOCTYPE
The code below works very well for resizing an image by aspect ratio by
I have a php mail script that works well except for one minor fact.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.