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 7689733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:13:59+00:00 2026-05-31T20:13:59+00:00

I had the sample facebook login implementation, and just realized that it stopped working:

  • 0

I had the sample facebook login implementation, and just realized that it stopped working:

 <?php
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
  'appId'  => 'myappid',
  'secret' => 'mybigsecreet',
  'cookie' => true,
));

// We may or may not have this data based on a $_GET or $_COOKIE based session.
//
// If we get a session here, it means we found a correctly signed session using
// the Application Secret only Facebook and the Application know. We dont know
// if it is still valid until we make an API call using the session. A session
// can become invalid if it has already expired (should not be getting the
// session back in this case) or if the user logged out of Facebook.
$session = $facebook->getSession();

$me = null;
// Session based API call.
if ($session) {
  try {
    $uid = $facebook->getUser();
    $me = $facebook->api('/me');

        $r = new registro_usuarios();
        $r->facebook($uid,$me['name'],'https://graph.facebook.com/'.$me['id'].'/picture');

        echo '----------------------------'.$me;
  } catch (FacebookApiException $e) {
    error_log($e);
    echo '----------------------------'.$e;
  }
}else echo 'nosession';
echo $session;

prints nosesion but when i click the login button (facebook) firebug logs: FB.login() called when user is already connected. and the login popup (facebook) won’t open.

What am I missing? Is the facebook-api outdated one year later??

  • 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-31T20:14:00+00:00Added an answer on May 31, 2026 at 8:14 pm

    $facebook->getSession() is no longer working. That’s why it might be exiting from 1st if loop.

    $session = $facebook->getSession();

    $session is always null.

    You can check seesion by $facebook->getUser() if it gives 0 then there is no active session else you will get facebook id of session user.

    See this links also might get more inforamation:

    • $facebook->getSession(); not working. No idea why?
    • Facebook PHP SDK getSession() fails to get session. Cookie problem?
    • $facebook->getSession() returns null in the example code. is that ok?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample I am working in
Do anyone tried GLPaint sample application with OpenGl ES 2.0 ? I had a
I want to have sample application on phoneGap for iphone. i had done some
I had created some sample webpages in php and i need to know how
I had make a simple app into a facebook page and I just want
I had some sample code I was working on and broke the link to
I've had a look at the metronome sample given by Apple, however, the sample
Just a simple question: if I had a simple vector class: class Vector {
I am new to the group and just had a simple question about the
I had a realtivley simple ajax application, which I have broken up to be

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.