Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public function login()
  2. {
  3. if ($this->validate()) {
  4. return Yii::$app->user->login($this->getUser(), 0);
  5. }
  6. return false;
  7. }
  8.  
  9. 'user' => [
  10. 'identityClass' => 'appmodelsUser',
  11. 'enableAutoLogin' => true,
  12. ],
  13.  
  14. 'user' => [
  15. 'identityClass' => 'appmodelsUser',
  16. 'authTimeout' => 60 * 60 * 24 * 100, //100 дней для примера
  17. ],
  18.  
  19. 'user' => [
  20. 'identityClass' => 'appmodelsUser',
  21. 'enableAutoLogin' => true,
  22. 'identityCookie' => ['name' => '_identity', 'httpOnly' => true]
  23. ],
  24.  
  25. public static function findIdentity($id)
  26. {
  27. return static::findOne($id);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement