There is a site on Kohana 3.3, after registering a user,

Auth::instance('database')->login('login', 'password', true) 

On the segment refuses to authorize the user, like this:

 Auth::instance()->force_login('login') 

Everything is fine if you try to compare the password hash:

 Auth::instance()->password('login') Auth::instance()->hash('password') 

It all fits .. What could be the problem, where to dig?

config / auth.php

  return array( 'driver' => 'ORM', 'hash_method' => 'sha256', 'hash_key' => 12, 'lifetime' => 1209600, 'session_type' => Session::$default, 'session_key' => 'auth_user', ); 

config / session.php

  return array( 'native' => array( 'name' => 'session', 'lifetime' => 43200, ), 'cookie' => array( 'name' => 'session', 'encrypted' => FALSE, 'lifetime' => 43200, ), 'database' => array( 'name' => 'session', 'encrypted' => FALSE, 'lifetime' => 1209600, 'group' => 'default', 'table' => 'user_sessions', 'columns' => array( 'session_id' => 'session_id', 'last_active' => 'last_active', 'contents' => 'contents' ), 'gc' => 500, ), ); 

bootstrap.php

 ........ Cookie::$salt = '34hg6jfd74jh69c746nbe65hd565'; if (PHP_SAPI != 'cli') Cookie::$domain = $_SERVER['SERVER_NAME']; Session::$default = 'database'; ....... 

    1 answer 1

    Forgot to add 'login' role for users

    • Is this a solution to your question or a clarifying comment? - Visman