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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:21:52+00:00 2026-05-24T23:21:52+00:00

I am trying to integrate Facebook into a web app that I am working

  • 0

I am trying to integrate Facebook into a web app that I am working on. I got an api key and secret key from Facebook, and have set the Site Url to http://www.mysite.com/something/app/

The following code is used from http://www.mysite.com/something/app/signup/xxxx/ to detect whether the user is connected or not:

        $facebook = new Facebook(array(
          'appId'  => FB_APIKEY,
          'secret' => FB_SECRETKEY,
          'cookie' => true  
        ));

        $session = $facebook->getUser();

        if($session) {
            # Active session, let's try getting the user id (getUser()) and user info (api->('/me'))
            try{
                $uid = $facebook->getUser();
                $user = $facebook->api('/me');
            } catch (Exception $e){}

            if(!empty($user)){
                # User info ok? Let's print it (Here we will be adding the login and registering routines)
                echo $user;
            } else {
                # For testing purposes, if there was an error, let's kill the script
                die("There was an error.");
            }
        } else {
            # There's no active session, let's generate one
            $login_url = $facebook->getLoginUrl();
            header("Location: ".$login_url);
        }

But the problem is, when the user is redirected to $login_url, it keeps redirecting back, creating an infinite loop.

The redirect url is: https://www.facebook.com/connect/uiserver.php?app_id=xxxxxxxxxxx&method=permissions.request&display=page&next=http%3A%2F%2Fwww.something.com%2Fsomething%2Fapp%2Fsignup%2Fxxxxx%2F&response_type=code&state=6f51768c22974a16b5dcf4d8dc7f46df&fbconnect=1

I have looked at other similar issues on SO, and also on Google and have tried their solutions but it just didn’t help me out.

[UPDATE]

Ok I think I am onto something. If I log in as a different Facebook user, I am not being redirected in a loop. It seems to happen only when I use my own Facebook account, which is the admin of the app. But after the redirect it should return getUser() right.. but it doesn’t for some reason.

Any ideas? Thanks.

  • 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-24T23:21:54+00:00Added an answer on May 24, 2026 at 11:21 pm

    I started from scratch on a new .php file from the root of my server. There everything was working alright, so I found out that my own code was causing the webpage to redirect.

    In fact, it was the mod_rewrite in my .htaccess file that as messing things up. Somehow it is not picking up the GET variables set by FB. So I need to figure out something for it. But at least I now know what caused the problem. Case closed!

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

Sidebar

Related Questions

I'm trying to intergrate Facebook Connect into an GAE app. I've got a basic
I'm trying to integrate an accounting solution into a web app I am developing.
I'm trying to integrate a public message board service into an existing web site.
We've got some problems with an external company trying in integrate into a WCF
I am trying to integrate pages from a site I am building into the
I am trying to integrate one of my websites with facebook connect. I have
I am trying to integrate facebook in my iphone application. after logged in from
I'm trying to integrate some photo related functionality with my site and facebook. I
While trying to integrate Yahoo Media Player into my own website, I want to
I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on

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.