php - Redirect loop when trying to publish a checkin via Facebook API -


I am trying to publish checkin using facebook api. Occasionally, it works well and checkin posts, but most 99% of the time this error generates: "This webpage is a redirect loop"

checkin.php:

  & lt ;? Php is required (".. / src / facebook.php"); // Creating an object with your Facebook app data $ Facebook = new Facebook (array ('appId' => gtxxxx ',' secret '= & gt;' XXXX ',' cookie '= & gt; wrong) ;); $ Token = $ facebook-> GetAccessToken (); // echo $ token; Exit ()) Try to get the user ID currently logged in, if you want you can manually set a user id here like this: // $ uid = '[FB USER] Id] '; $ Uid = $ facebook-> GetUser (); $ Facebook & gt; SetAccessToken ($ Tokens); $ Facebook- & gt; API ('/' .UID / Checkin ',' Post ', Array (' AccessToken '=> gt; & gt; MilengeToken (),' Location '=>' 101697613295949 ',' Message '= & Gt; enjoying cold beer with team ',' picture '= & gt;' http://test.com/someplace.png ',' coordinates' = & gt; json_encode (array ('latitude' = & Gt; '28 .541203543000023 ',' Longitude '= & gt; '77 .15503053709995', 'Tag' => XXXX '))); The echo 'you are checking in'; } Hold (exception $ E) {// no user was found - $ login_array = $ facebook-> GetLoginUrl (); Header ("Location:" $ login_url); }? & Gt;  

Thanks in advance


Comments