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

  • SEARCH
  • Home
  • 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 8725269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:00:22+00:00 2026-06-13T08:00:22+00:00

Regards, I have a problem with Facebook SDK-PHP and Codeigniter. I do not get

  • 0

Regards,

I have a problem with Facebook SDK-PHP and Codeigniter.

I do not get the user’s session when I try to capture and obtain basic data for that user.

The error I get is: “An active access token must be used to query information about the current user.”

And when I apply the “getUser ()”, I get “0”.

NOTE: I download the php-sdk and put on my directory libraries the files base_facebook.php and facebook.php

In my application/config/config.php I put the key and app_secret of my facebook application.

Config.php :

$config['base_url'] = 'http://localhost/myapp_local';
$config['app_id'] = 'xxxxxxxxxxxxxx';
$config['secret'] = 'xxxxxxxxxxxxxxxxxxxxxxxx';
$config['app_name'] = 'http://apps.facebook.com/myapp_local/';

In my Controller Main.php i have the follow code:

class Main extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $fb_config = array(
            'appId' => $this->config->item('app_id'),
            'secret' => $this->config->item('secret')
        );
        $this->load->library('facebook', $fb_config);

    private function _getInfoUserFB() {
        try {
            $fb_id = $this->facebook->getUser();
            if ($fb_id) {
                $fb_data = $this->facebook->api('/me');
                return $fb_data;
            }
        } catch (Exception $exc) {
            echo $exc;
        }
    }
       [....]
}

Now, in my variables $fb_id , where obtain the bool value, always i have “0”.
So, when i try to get the data of the current user facebook always i have a Exception with the message: “An active access token must be used to query information about the current user.”

$fb_data['id'] = NULL
$fb_data['first_name'] = NULL
$fb_data['last_name'] = NULL

What i doing wrong here? Any step or setting I miss?

NOTE 2: I don’t have some button Login with Facebook, my app connect directly to facebook via the configuration of my app on facebook. (Canvas URL, Secure Canvas URL, Canvas Page, Site URL)

Note 3: My application have some permission that need require, So I put the necessary permissions on Settings-Permissions BUT don’t show me the option of “Auth Referrals” to show Dialog confirm permissions.

I use CodeIgniter version 2.1.3 and PHP-SDK v 3.2.0

  • 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-06-13T08:00:23+00:00Added an answer on June 13, 2026 at 8:00 am

    You have to go to Facebook Developer Site -> Apps -> Permission. And set the basic info permission for your app.

    Then in your function getLoginUrl(array("scope" => "user_about_me))), you have to give the parameters.

    Finally you have to save the access token $this->facebook->getAccessToken();

    If you have problems you can ask me. I have setup my Codeigniter with nearly all Social Media Platforms 🙂

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

Sidebar

Related Questions

Problem PHP session in different folder. I have problem with PHP session. There are
I have this problem in regards with default, since I m not sure whether
I have a problem with jquery not loaded in an asp user control. I
I have a problem with regards to writing the correct regex for the examination
i have a question in regards to php calculations. i am restructuring a text
I have a problem with the behavior of Firefox 4 in regards to parameters
I have a problem with getting some html value stored in a php array:
I have a problem, I use pcntl_fork to fork a process in PHP, $pid
I have a small doubt , I am using facebook javascript sdk to authenticate
I'm trying to make native facebook aplication in python. I have problem with extended

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.