1

He there,

I am working on a facebook app, which is working fine. I have one problem however; when I send somebody a link to visit the site and have them login, I receive an error message at my login callback page. This does not happen when the url is typed directly in the browser. Am I missing something here?

Error message:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The default access token must be of type "string" or Facebook\AccessToken' in /home/ckreeftmeijer/public_html/foundation/vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php:298 Stack trace: #0 /home/ckreeftmeijer/public_html/foundation/login-callback.php(35): Facebook\Facebook->setDefaultAccessToken(NULL) #1 {main} thrown in /home/ckreeftmeijer/public_html/foundation/vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php on line 298 

My acces token is string, as defined by

$_SESSION['facebook_access_token'] = (string) $accessToken; 

so I don't see why this is happening.

Thanks in advance

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • It would be nice if you could add both urls in your description: The one that works vs the one that doesn't. There is not enough information here to understand what's going on. – curveorzos Aug 11 '15 at 23:55
  • Please read [How does accepting an answer work?](http://meta.stackoverflow.com/questions/5234/how-does-accepting-an-answer-work) instead of editing your question title – Quentin Aug 12 '15 at 14:41
  • @corvuszero Thank you for the reply. the url's were identical. Only when accessed when for example clicking the link from an email it did not work, however when i typed the exact same url in the address bar there was no problem – Christiaan Kreeftmeijer Aug 13 '15 at 09:53
  • I have tried numerous things and the error message is now "Graph returned an eror: Error validating access token: Session does not match current stored session. This may be because the user changed the password since the time the session was created or Facebook has changed the session for security reasons." url is www.youddress.com/foundation . Login is top right – Christiaan Kreeftmeijer Aug 13 '15 at 10:29

1 Answers1

0

Found the answer.

It was my $loginUrl. I forget to add www.

Works fine now. Thank you for taking the time to respond