php - Facebook Error validating access token: Session has expired at unix time -


i have integrated offline wall posting users of website have linked fb accounts there user details. have stored there fb-id, fb-access token in database , using php-sdk libraries had integrated feed wall posting in website. worked users getting messages on there facebook wall. today things went in vain throws various kinds of error. have been searching more documents can't find exact relevant solution issues.

lines of code have used fb-wall posting

             $usid=$pageinfo['user']['id_facebook'];     $accestoken=$pageinfo['user']["facebook_accesstoken"];          if($pageinfo['user']['user_fbtoken']=='1')           $attachment =  array(         'access_token' => $accestoken,         'message' => "mytaste || real restaurant reviews, share taste on mytaste",         'name' => "my favorite restaurant ".$business['name'].$business['location']['city']."-what yours? ",         'link' => $business['personal_url'],         'description' => "",          'picture'=> "http://googima.com/images/mysite.gif"         );            $facebook->api("/".$usid."/feed", "post",$attachment);      } 

error messages:

 uncaught oauthexception: error validating access token: session has expired @ unix time   uncaught oauthexception: (#210) user not visible thrown in /hsphere/local/home/mysite.com/include/3rdparty/facebook-php-sdk/src/facebook.php 

the main idea of doing offline wall posting user not going asked fb login each time when reviews in website. need post automatically using fb details have stored in user table.

once grant publish_stream permission, no need access_token. removing , using work without valid session (just example):

$params =  array(     'message' => "test message",     'picture'=> "http://path/to/image.jpg" );   $post_id = $facebook->api("/$uid/feed", "post",$params); 

for more information refer answer (edit 4). kudos @zerkms info btw!


Comments