php - Facebook api keeps returning " authorization code has been used ." even though I get logged in .. what's the cause? -
so have error trying fix in code below , api returns code below
error: exception occured getting facebook session message: authorization code has been used... cause ?
function setredirectloginsession(){ $helper = new facebook\facebookredirectloginhelper($this->redirecturi); try { if(!($this->facebooksession instanceof facebook\facebooksession)){ $this->facebooksession = $helper->getsessionfromredirect(); } else { //if coming facebook app have signed request if(isset($_request['signed_request']) ){ $this->facebooksession = facebook\facebooksession::newsessionfromsignedrequest($_request['signed_request']); }else{ $is_valid = $this->facebooksession->validate($this->client_id,$this->client_secret); if(!$is_valid) $this->newfbsession(); } } } catch(facebookrequestexception $ex) { systemerror("facebookrequestexception occured getting facebook session message: " . $ex->getmessage()); } catch(\exception $ex) { systemerror("exception occured getting facebook session message: " . $ex->getmessage()); } }
Comments
Post a Comment