I am getting this issue while logging in sometime, After search I got that its related to something session/cookie that already exist of previous login. But still couldn't found the solution.
here is my code:
$auth = new \Hybrid_Auth(Yii::$app->params['hybridConfig']);
$adapter = $auth->authenticate($provider);
$user_profile = $adapter->getUserProfile();
$accessToken = $adapter->getAccessToken();
$adapter->logout();
and In hybrid lib facebook provider code:
try{
$fields = array(
'id', 'name', 'first_name', 'last_name', 'link', 'website',
'gender', 'locale', 'about', 'email', 'hometown', 'location'
);
$data = $this->api->api('/me?fields=' . implode(',', $fields))
}
catch( FacebookApiException $e ){
throw new Exception( "User profile request failed! {$this->providerId} returned an error: $e", 6 );
}