title: FB-api: The user hasn't authorized the application to perform this action
body: <p>I try to post on my wall using facebook api, and offline access tokens. 
  And every time I has one mistake:</p>
  
  <blockquote>
    <p>Uncaught OAuthException: (#200) The user hasn't authorized the
    application to perform this action</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>require 'api/facebook.php';
  
      $facebook = new Facebook(array(
          'appId'  =&gt; "app_id",
          'secret' =&gt; "app_sec",
          "cookie" =&gt; true,
          'fileUpload' =&gt; true
      ));
  
      $facebook-&gt;setFileUploadSupport(true);  
  
      $access_token = $facebook-&gt;getAccessToken();
      $user_id = $facebook-&gt;getUser();
  
  $result = mysql_query("UPDATE users SET user_id_facebook='".$user_id."' WHERE id='".$myrow2['id']."'",$db);
  $result = mysql_query("UPDATE users SET access_token_facebook='".$access_token."' WHERE id='".$myrow2['id']."'",$db);
  
      if($user_id == 0 || $user_id == "")
      {
          $login_url = $facebook-&gt;getLoginUrl(array(
          'redirect_uri'         =&gt; "http://apps.facebook.com/rapid-apps/",
          'scope'      =&gt; "email,publish_stream,user_hometown,user_location,user_photos,friends_photos,
                      user_photo_video_tags,friends_photo_video_tags,user_videos,video_upload,friends_videos,offline_access"));
  
          echo "&lt;script type='text/javascript'&gt;top.location.href = '$login_url';&lt;/script&gt;";
          exit();
      }
  
      $post =  array(
      'access_token' =&gt; $access_token,
      'message' =&gt; 'This message is posted with access token - '
  );
  
  $res = $facebook-&gt;api('/me/feed', 'POST', $post);
  </code></pre>