Note that there are some explanatory texts on larger screens.

plurals
  1. POfacebook access_tokens in php and js diffeerent?
    primarykey
    data
    text
    <p>I am going crazy here,</p> <p>i dont understand how facebook handles the token thing. I use php sdk for web login. This works, i can get with</p> <pre><code>$facebook-&gt;api('/me'); </code></pre> <p>the data from user etc. </p> <p>But after a short time i do get the <strong>*</strong> fb error:</p> <pre><code>OAuthException: An active access token must be used to query information about the current user. </code></pre> <p>even though the user is still logged in. When i disconnect and login with facebook again, i do not get a new token (i think because the cookie is still active?)</p> <p>When i delete all cookies it works for a while.</p> <p><strong>BUT</strong> when i check back with JS SDK </p> <pre><code>FB.getLoginStatus(function(response){FB.api('/me', function(response) {});}); </code></pre> <p>I always have an active access_token and within it i can call the api, but only within...</p> <p>Why i cannot use the same token in php and js or why are they different?????</p> <p>Please help me.</p> <p><strong>EDIT</strong></p> <p>To explain it better. In php the access_token changes from e.g. 'CDAtEg' etc. to '148234' etc. (dont know why). if i do the api request in php i got the OAuthException but in js SDK the old Token 'CDAtEg' is still active and i got the user_data till the token exprires.</p> <p>Why i cannot use the same token in php again and why it is deleted? I do not find the reason for that.</p> <p><strong>EDIT 2</strong></p> <p>Thank you for your ideas so far. I found out two things now. First, when i save the token i get from JS SDK and use it with</p> <pre><code>$facebook-&gt;setAccessToken() </code></pre> <p>it seems to work so far. Second, as phwd posted below the user_access token i got from php is deleted after 2,3 minutes. How can i found the origin of this problem? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload