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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:16:24+00:00 2026-06-04T12:16:24+00:00

After i login using Facebook connect,I need to redirect user to particular URL.The below

  • 0

After i login using Facebook connect,I need to redirect user to particular URL.The below code works in firebox.but not in chrome.please help me

 <script type="text/JavaScript">
          FB.init({
              appId: '366168323431073', cookie: true,
              status: true, xfbml: true
          });
          FB.Event.subscribe('auth.login', function () {
              window.top.location = "http://www.domain.com";
          });
      </script>
  • 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-04T12:16:25+00:00Added an answer on June 4, 2026 at 12:16 pm

    change the redirect uri in your app

    or

    <?php
    
    // Requires Facebook PHP SDK 3.0.1: https://github.com/facebook/php-sdk/
    require ('facebook.php');
    
    define('FACEBOOK_APP_ID',"YOUR-APP-ID-HERE");
    define('FACEBOOK_SECRET',"YOUR-APP-API-SECRET-HERE");
    define('REDIRECT_URI',"YOUR-REDIRECT-URL-HERE");
    $user = null;
    
    $facebook = new Facebook(array(
        'appId' => FACEBOOK_APP_ID,
        'secret' => FACEBOOK_SECRET,
        'cookie' => true
    ));
    
    $user = $facebook->getUser(); // Get the UID of the connected user, or 0 if the Facebook user is not connected.
    
    if($user == 0) {
        // If the user is not connected to your application, redirect the user to authentication page
        /**
         * Get a Login URL for use with redirects. By default, full page redirect is
         * assumed. If you are using the generated URL with a window.open() call in
         * JavaScript, you can pass in display=popup as part of the $params.
         * 
         * The parameters:
         * - redirect_uri: the url to go to after a successful login
         * - scope: comma separated list of requested extended perms
         */
    
        $login_url = $facebook->getLoginUrl($params = array('redirect_uri' => REDIRECT_URI));
    
        echo ("<script> top.location.href='".$login_url."'</script>");
    
    } else {
        // if the user is already connected, then redirect them to landing page or show some content
        echo ("<script> window.location.href='".REDIRECT_URI."'</script>");
    }
    

    ?>

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

Sidebar

Related Questions

I'm using facebook connect to let users login my application easy. It works well,
Im trying to test my successfully creates a new user after login (using authlogic).
I am using following steps to update code on server after login to server:
I'm using modx-2.2.0-pl2 (revo). Did a clean install without any error, but after login
I am building an Facebook IFrame App. I am using the below javascript code
I am using Facebook PHP SDK to authenticate the user. After generating the LoginUrl
I'm using the Facebook Connect API for the login system on a website built
I'm using Rails, Devise, and Omniauth, and I'm trying to login using facebook connect.
I am using the facebook connect to login into my website. In my html
I'm building a page using Facebook Connect, and the interaction in relation to Login/Logout

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.