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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:20:10+00:00 2026-05-20T18:20:10+00:00

I was following the tutorial here: http://net.tutsplus.com/tutorials/php/how-to-authenticate-your-users-with-facebook-connect/ But I can’t get past the first

  • 0

I was following the tutorial here: http://net.tutsplus.com/tutorials/php/how-to-authenticate-your-users-with-facebook-connect/

But I can’t get past the first step in allowing users to authorize my app. The app is at http://apps.facebook.com/freelancergame/ while the canvas URL is http://freelancer.xylotgames.com

I check via PHP whether there is an active session with the user. If it doesn’t exist, I redirect the user to the login URL. Here is the code at the top of the page:

// Facebook library
require 'src/facebook.php';

// Create our Application instance
$facebook = new Facebook(array(
    'appId'  => 'xxxxxx',
    'secret' => 'xxxxxxxxxxxx',
    'cookie' => true,
));

// Let's see if we have an active session
$session = $facebook->getSession();

$me = null;
// Session based API call.
if (!empty($session)) {
    // Active session; let's try getting the user ID and info
    try {
        $uid = $facebook->getUser();
        $me = $facebook->api('/me');
    } catch (FacebookApiException $e) {
        error_log($e);
    }
    $logoutUrl = $facebook->getLogoutUrl();
    print_r($user);
    exit();
} else {
    // There's no active session; let's generate one
    $loginUrl = $facebook->getLoginUrl();
    header('Location: ' . $loginUrl);
}

The thing is, upon visiting http://apps.facebook.com/freelancergame/ I am brought to a screen with the blue Facebook logo and a link saying “Go to Facebook.com”.

However, if I allow the user to click a link to connnect with Facebook like so:

<a href="<?php echo $loginUrl ?>" target="_top">Connect</a>

…the “Allow/Don’t Allow” dialog shows up directly from Facebook’s website, but if I click “Allow” or “Don’t Allow”, it goes directly to my canvas page (http://freelancer.xylotgames.com) instead of the embedded app page, which I’d prefer.

How can I get this to work? I see apps/games that use a pop-up instead of redirection. Is this preferred? If so, how would I do it? Why won’t the NetTuts+ tutorial work for me when it most likely works for others?

  • 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-20T18:20:10+00:00Added an answer on May 20, 2026 at 6:20 pm

    I prefer the popup method (or iframe dialog inside Facebook), which you can open with the JS SDK:

    • Regular HTML popup: FB.login function. http://developers.facebook.com/docs/reference/javascript/fb.login/

    • Iframe dialog: FB.ui function. How to show the Extended Permission Dialog in FB using new Graph API?

    For your redirection issue, I would double check the URLs in the configuration of the app.

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

Sidebar

Related Questions

I am following the tutorial here: http://www.aspfree.com/c/a/XML/Applying-XSLT-to-XML-Using-ASP.NET/2/ The tutorial shows how one converts xml
I am following a tutorial from nettuts, specifically here: http://blog.themeforest.net/tutorials/jquery-for-absolute-beginners-day-11/ I am 3/4's of
I was following this tutorial: http://www.marcofolio.net/webdesign/a_fancy_apple.com-style_search_suggestion.html And checking out the demo here: http://qpoit.com/marcofolio_demo/apple_search/ I
I'm following the tutorial here: http://docs.jquery.com/Plugins/Authoring I just wanted to create a simple plugin
Hi I am quite new to php but i have been following some tutorials
I'm following the tutorial located at: http://www.asp.net/learn/mvc/tutorial-20-cs.aspx I created my own .Menu() method to
I am currently following NeHe tutorial lesson 43 ( http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=43 ). The code works
I am following ScottGU tutorial : A Simple E-Commerce Storefront Application http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx I can't
I'm following the rails tutorial here: http://railstutorial.org/chapters/filling-in-the-layout#top When I run rspec spec/, I get
I am trying to go through the following tutorial on asp.net. When I get

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.