You do not call a loginByCookiefunction, it is automatically called for you. First, you log in by calling \Yii::$app->login()with an identifier, but it is User::$enableAutoLoginturned on. Duration is used to determine TTL cookies. The structure supports cookies.
As an example, just check out the LoginForm-class in the main application.
Blizz source
share