$dataUser = $form_model->findIdentity(1); //ищем пользователя по id
echo '<pre>';
var_export($dataUser);
echo '</pre>';
if($dataUser){ //если все ок то аутефицируем пользвателя
//
Yii::$app->user->login($dataUser,1000*60); //логиним
echo '<pre>';
var_export(Yii::$app->session); //сессии пустые.
echo '</pre>';
die;
return $this->redirect('admin'); //редириктим в админку.
}
app\models\User::__set_state(array(
'id' => NULL,
'username' => NULL,
'password' => NULL,
'authKey' => NULL,
'accessToken' => NULL,
'_user' => NULL,
'_attributes' =>
array (
'id' => 1,
'name' => 'Виталий литвинов (Логин)',
'email' => 'cheltend@mail.ru',
'login' => 'Vitaly',
'hash' => '$2y$13$FhwINt3v2fxUqusA5ZsiHOc5fjhXMGkvNEHFSb0DqQmaGq2bsPV1e',
'block' => 0,
'registerDate' => '2019-01-16 00:00:00',
'lastVisit' => NULL,
'resetCount' => NULL,
'lastReset' => NULL,
'params' => NULL,
'photo' => NULL,
'access_token' => 'sdsad',
),
'_oldAttributes' =>
array (
'id' => 1,
'name' => 'Виталий литвинов (Логин)',
'email' => 'cheltend@mail.ru',
'login' => 'Vitaly',
'hash' => '$2y$13$FhwINt3v2fxUqusA5ZsiHOc5fjhXMGkvNEHFSb0DqQmaGq2bsPV1e',
'block' => 0,
'registerDate' => '2019-01-16 00:00:00',
'lastVisit' => NULL,
'resetCount' => NULL,
'lastReset' => NULL,
'params' => NULL,
'photo' => NULL,
'access_token' => 'sdsad',
),
'_related' =>
array (
),
'_relationsDependencies' =>
array (
),
'_errors' => NULL,
'_validators' => NULL,
'_scenario' => 'default',
'_events' =>
array (
),
'_eventWildcards' =>
array (
),
'_behaviors' =>
array (
),
))
yii\web\Session::__set_state(array(
'flashParam' => '__flash',
'handler' => NULL,
'_cookieParams' =>
array (
'httponly' => true,
),
'frozenSessionData' => NULL,
'_hasSessionId' => true,
'_events' =>
array (
),
'_eventWildcards' =>
array (
),
'_behaviors' => NULL,
))