Created
May 1, 2020 15:31
-
-
Save monbang/80be44f8aff1fb184a0e7c44c9cc0c0d to your computer and use it in GitHub Desktop.
Yii2 module wise user login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function init() | |
{ | |
parent::init(); | |
Yii::$app->set('user', [ | |
'class' => 'yii\web\User', | |
'identityClass' => 'app\models\Editor', | |
'enableAutoLogin' => false, | |
'loginUrl' => ['yonetim/default/login'], | |
'identityCookie' => ['name' => 'editor', 'httpOnly' => true], | |
'idParam' => 'editor_id', //this is important ! | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment