20100523

Facebook 鬼打牆之auth_tokan

寫Facebook時,遇到一個問題,頁面會一直卡在auth_tokan,這參數還愈跳愈長
http://xxxxx/?auth_tokan=xxxxxxxxxxxxxxx
網頁常常就在那跳,簡直就是鬼打牆
目前測都還OK,不知道什麼時候會再撞到牆XD

$fb_obj = new facebook($appapikey, $appsecret);
$uid = require_login(&fb_obj,$appapikey, $appsecret);

function require_login(&fb_obj,$appapikey, $appsecret)
{
  if(isset($_GET['auth_tokan']))
  {
    $s = $fb_obj -> do_get_session($_GET['auth_tokan']);
    $fb_obj -> set_user($s['uid'], $s['session_key'], $s['expires'], $s['secret']);
    return $s['uid'];
  }
  $uid = $fb_obj->require_login();
  return $uid;
}

沒有留言: