function fblogin(){
$base_url=$this->config->item('base_url');
$facebook = new Facebook(array(
'appId' => $this->config->item('appID'),
'secret'=> $this->config->item('appSecret'),
));
$user = $facebook->getUser();
if($user){
try{
$user_profile = $facebook->api('/me');
$params = array('next' => $base_url.'Poll/logout');
$ses_user=array(
'User' => $user_profile,
'logout' => $facebook->getLogoutUrl($params)
);
$this->session->set_userdata($ses_user);
header('Location: '.$base_url);
}catch(FacebookApiException $e){
error_log($e);
$user = NULL;
}
}
echo error_log($e);
$user = $this->session->userdata('User');
echo $user['id'];
$this->load->view('main');
}
当echo error_log($ e)显示(1) 和var_dump(error_log($ e))显示bool(true)
但在localhost工作正常
答案 0 :(得分:0)
在没有js的php sdk中工作 但仍然不知道原因