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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:38:38+00:00 2026-05-27T02:38:38+00:00

The case: We plug-in FB JS and init it with FB.init() . This call

  • 0

The case:

  1. We plug-in FB JS and init it with FB.init(). This call creates fbsr_NNNNN cookie. The cookie has session-limited expiration date (until browser is closed). We call FB.init() only once in this example. After that we call the pages that don’t contain FB.init() invocations so it doesn’t have a chance to renew the access_token
  2. We perform authentication and make some server-side (PHP FB SDK) call, like /me
  3. Wait for 30 minutes or something until FB session expires
  4. Perform the /me request again and see “An active access token must be used to query information about the current user.”

This happens because current php sdk implementation:

  public function getSignedRequest() {
    if (!$this->signedRequest) {
      if (isset($_REQUEST['signed_request'])) {
        $this->signedRequest = $this->parseSignedRequest(
          $_REQUEST['signed_request']);
      } else if (isset($_COOKIE[$this->getSignedRequestCookieName()])) {
        $this->signedRequest = $this->parseSignedRequest(
          $_COOKIE[$this->getSignedRequestCookieName()]);
      }
    }
    return $this->signedRequest;
  }

just takes the access_token from cookies as-is and in case of exception it doesn’t clear it. So the code has no chance to return into normal workflow without manual cookie removing. Yes, if I delete the cookie – the code starts to work again (as long as there is no saved access_token and library fetches the new actual one).

So what workaround for this issue would you propose? What do you use? Do you think it is a bug?

UPD: seems like there is a possible workaround: to extend Facebook class and override the method that cleans persistent storages. For details look at discussion to the answer http://facebook.stackoverflow.com/a/8294559/251311

But I’m personally still sure that FB SDK should handle it without any additional hacks

  • 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-27T02:38:39+00:00Added an answer on May 27, 2026 at 2:38 am

    First: I have no experience with Facebook itself, but the OAuth 2 RFC specifies a refresh_token – consider implementing it.

    Second: Facebook returns an error, right? If that error occurs just unset the cookie. If that doesn’t work with your current implementation you’re doing something wrong – pretty much every Twitter library I have seen (also uses OAuth, albeit 1.0a) uses its own HTTP wrapper. Rather than giving back an URL to request you simply execute the request yourself.

    Third: What if you simply set a timeout on the cookie? I’m rather sure OAuth also gives you an expires_in value, simply use it (do take 5 seconds off this value, because of network lag etc).

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

Sidebar

Related Questions

Nothing I've found has been able to help me solve this one specific case.
case i of 0..99 : Function-call('bobo') ; 100..209 : function-smell('Hobo'); 210..300 : function-yikes('argh'); end;
Case One: new Date(Date.parse(Jul 8, 2005)); Output: Fri Jul 08 2005 00:00:00 GMT-0700 (PST)
I am using cookie plug in my application. where i display some information from
From searching online, I learnt that until July 2010, Blackberry Java Plug-in for Eclipse
This is a question I've come across repeatedly, usually concerning plug ins, but recently
We are using org.mule.tck.FunctionalTestCase for test cases. Its an abstract JUnit test case. This
I have an Acl plug-in which extends Zend_Controller_Plugin_Abstract , this plug-in handles all my
... case 1: string x = SomeString; ... break; case 2: x = SomeOtherString;
Case in point : I've got a handle to a window (for instance, using

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.