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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:21:49+00:00 2026-05-29T08:21:49+00:00

REVISED QUESTION I realize using the response to: $facebook->api(‘/me?access_token=’.$access_token) will determine whether you need

  • 0

REVISED QUESTION

I realize using the response to: $facebook->api('/me?access_token='.$access_token) will determine whether you need a new access token. So my question below can be simplified to this:

If the user has not deauthorized the app, is there an FB-approved way to get a new access token without a redirect to the auth log?


OLD QUESTION

As pointed out in this question, Facebook (offline) access tokens expire for a variety of reasons. This solution is provided by Facebook for reauthorizing and grabbing a new offline access token.

However, that solution assumed I want the following behavior:

  1. Redirect my users to auth dialog
  2. If they haven’t deauthorized my app, I automatically get a new access token
  3. If they have deauthorized my app, they will get an auth dialog box to reauthorize.

However,

  • If the user has not deauthorized my app, I would like a new access token.
  • If the user has, I do not want an auth dialog (nor a new access token).
  • Ideally, this could be done in PHP, without redirects to auth dialogs
  • 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-29T08:21:49+00:00Added an answer on May 29, 2026 at 8:21 am

    If you app is authorized by the user, you can get a new access token with this javascript:

        FB.getLoginStatus(function(response) {
            if (response.status === 'connected') {
                user_id = response.authResponse.userID;
                access_token = response.authResponse.accessToken;
            }
         }
    

    This will not prompt the user for a redirect to auth log. Simple stuff documented in Facebook’s getLoginStatus.

    This of course won’t work, unless the user is logged into Facebook, has authorized your app, and visits your page (for my purposes this assumption was fine). But you can ask for offline_access permission and store the new access key for later use of course.

    My question said ideally this would be handled server side. Unfortunately, the behavior of this php:

    $access_token = $facebook->getAccessToken();

    is not identical to the access token response generated by the Javascript SDK. See this question.

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

Sidebar

Related Questions

(Didn't mean to create a new question, but revised the old one enough that
aeon made me realize i need to revise my question. I have a chain
See Edit below initial question for a revised version of the original problem Using
REVISED QUESTION : We have tracked this down to a custom add to cart
This is a revised/better written version of the question I asked earlier today --
NOTE: I completely revised the question and turned it into an example project specifically
Edit: The original premise of the question was incorrect so revised the question: Basically
MAJOR EDIT: Problem was solved after reading Will Dean's comment. The original question is
This is the revised version of my previous question Paralleling trading software The code
My question is essentially the same as this one here . I'm using AnkhSVN

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.