Not so the module works. When logging in with the value $remember = TRUE , you must send cookies for 2 weeks with a token, and write the token to the database. And it sends cookies until the browser is closed (nothing without writing to the database) and with Auth::instance()->logout($destroy = TRUE) does not delete the cookie, although it should.

That's what's in the controller

  $login = Arr::get($_POST, 'login', ''); $password = Arr::get($_POST, 'password', ''); $remember = $_POST['remember']; $auth->login($login,$password, $remember); 

Here is the config auth.php

 return array( 'driver' => 'ORM', 'hash_method' => 'sha256', 'hash_key' => '2, 4, 6, 7, 9, 15, 20, 23, 25, 30', 'lifetime' => 1209600, 'session_type' => Session::$default, 'session_key' => 'auth_user', 
  • one
    The day before yesterday I did the authorization in kohana) $ remember because there is a logical variable. Make $ remember = isset ($ _ POST ['remember']); In general, everything seems to be normal. Should work - Vitaly Kustov
  • Nope, does not work - trane294
  • and remember you on the checkbox? Do I get it right? - Vitaly Kustov
  • yes he is on the checkbox - trane294

3 answers 3

Solved the problem only in this way:

 $auth->login($login,$password, TRUE); 

Otherwise, it does not work out as well when taking $ remember

  • var_dump($remember) watched? There are no miracles - Zowie
  • of course -_- - trane294
  • @AlexWindHope, NG on the nose. maybe there are =) @ trane294, and what does var_dump say? true or false? and when passing it as a parameter, nothing works? Similarly, fairy tales) - Vitaly Kustov
  • when it is received, if the value is not specified, it sends ON, $ auth-> login ($ _ POST ['username'], $ password, $ _POST ['remember'] == 'ON'? TRUE: FALSE)); does not work. Just send TRUE and paste it too. A lot that I tried does not work ( - trane294
  • okay. Say what exactly does not work then? Anyway, now I sit with kohana) - Vitaly Kustov
  $status = Auth::instance()->login($data['username'], $data['password'], isset($_POST['remember']) ? true: false); 

If the value from the checkbox is transferred to $ _POST ['remember'].

    Hello. When checking wardamp produces 1 or NULL. Therefore, I set the condition before login.

      $data = Arr::extract($_POST, array('username', 'password', 'remember')); //var_dump($data['remember']); //выдаёт 1 или NULL //die(); // Поэтому поставил условие перед логином. if($data['remember'] == 1) { $flag = TRUE; } else { $flag = FALSE; } $status = Auth::instance()->login($data['username'], $data['password'], $flag);