title: API error code 191 again
body: <p>There are a million questions on this but for some reason I still can't get it to work.  I don't have a canvas url or base url or whatever.  My two settings are:</p>
  
  <p>App Domain: mydomain.com
  Site Url: calendar.mydomain.com/account/fb/</p>
  
  <p>and the code I stole from fb is:</p>
  
  <pre><code>$app_id = $CFG['app_id'];
  $app_secret = $CFG['app_secret'];
  $my_url = "http://calendar.mydomain.com/account/fb/";
  
  $code = dv($_REQUEST["code"],'');
  
  if(empty($code)) {
   $_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection
  
      $VIEW-&gt;dialog_url = "https://www.facebook.com/dialog/oauth?client_id=" 
     . $app_id . "&amp;redirect_uri=" . urlencode($my_url) . "&amp;state="
     . $_SESSION['state'];
  
   echo '&lt;script&gt; top.location.href="'.$VIEW-&gt;dialog_url.'"; &lt;/script&gt;; etc...
  </code></pre>
  
  <p>actually, I'm not echoing anything, I have a view thingy, but you get the jist.
  Maybe it takes sometime for all the servers to get populated.</p>