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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:05:09+00:00 2026-05-26T06:05:09+00:00

I’m using facebook connect on my site and it works fine except for one

  • 0

I’m using facebook connect on my site and it works fine except for one small (but annoying) detail. Whenever a user logs in, they return to the original url they were at before except there is an extra piece added to the end of the url. For example, if the page was at http://www.domain.com, after logging in through facebook, the new url would be something like this:

www.domain.com/?state=407abe669787e4a97dc80c93d7ba5eae&code=AQDu0Vjf1hvo7N-TPmdsBygQCIxs7LfEfNMlf1aKNiyOeuAtDbIo-zTzWqWF7yv_Jsp4YOfkjQHqx17zsiCPYKxLyeL3BMdNr0HFnEu7Q50Hc2Ca92VfiDl9VWQJUDRYwjPDkpyZPJHOIkInaRA9xTivtuUtb5VCUGNvHSU7hRgb3muK-EKJ1p5iEnRjN1y7_Y8#_=_

I’m using the newest facebook PHP SDK (version 3.1.1 as of now) and I’m getting the login url just like in the example shown here: https://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/ by calling

$facebook->getLoginUrl(array('scope' => 'email', 'display' => 'touch'));

The url that it creates looks correct, something like this:

https://www.facebook.com/dialog/oauth?client_id=124847107591285&redirect_uri=http%3A%2F%2Fdomain.com&state=407abe669787e4a97dc80c93d7ba5eae&scope=email&display=touch

I would like it so that the url the user returns to post-login is exactly as it was, without the extra state and code values. I haven’t seen anything about this mentioned in the docs and this is really bugging me.

I’m wondering if anyone else has come across this, and if so, if there is a solution for it.

  • 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-26T06:05:09+00:00Added an answer on May 26, 2026 at 6:05 am

    Perhaps you didn’t look at the right docs page, but it says very clearly at https://developers.facebook.com/docs/authentication/ what is the purpose of those two parameters:

    If the user presses Allow, your app is authorized. The OAuth Dialog
    will redirect (via HTTP 302) the user’s browser to the URL you passed
    in the redirect_uri parameter with an authorization code:

    http://YOUR_URL?code=A_CODE_GENERATED_BY_SERVER

    With this code in hand, you can proceed to the next step, app
    authentication, to gain the access token you need to make API calls.

    As for the state parameter, this one is very important in preventing CSRF attacks.

    Cross site request forgery is an attack in which a trusted
    (authenticated and authorized) user unknowingly performs an action on
    website. To prevent this attack, you should pass an identifier in the
    state parameter, and then validate the state parameter matches on the
    response. We strongly recommend that any app implementing Facebook
    user login implement CSRF protection using this mechanism.

    To summarize, those parameters are important and are there for you to use it if you want to (and you should).

    If for any reason you don’t want your users to see that url you can do a check if they are set in your GET superglobal and if they are, redirect the user at the page you want, without those params beeing present.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.