php - I can't save user identity in yii2 -


i created module in yii2 under api/modules/v1 folder, problem when request:

yii::$app->user->login($user, 3600);  

the identity got saved temporary until refresh page or request url, when reviewed log file, found : user '1' logged in ::1. session not enabled. tried add :

'enableautologin' => true, 'enablesession' => true, 

user component configuration :

'user' => [         'identityclass' => 'common\models\user',         'enableautologin' => true,         'enablesession' => true,         'identitycookie' => [             'name' => '_apiuser', // unique backend             'path' => '/api/web/v1'  // correct path backend app.         ]     ],     'session' => [         'name' => '_apisessionid', // unique frontend         'savepath' => __dir__ . '/../runtime', // temporary folder on frontend     ], 

but same problem occurred.

have model common\models\user implements "login" method? if so, login code

yii::$app->user->identity->login($user, 3600);  

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -