I have a small app written in kohana 3.3. For login purposes I use auth module to log in as user.
Log in is simple and looks like that:
$auth = Auth::instance()->login($_POST['login']['username'], $_POST['login']['password']);
if(!$auth){
// fails + redirect
}else{
//success + redirect to user account
}
Auth config:
And user data is stored in db (password hashed):
Problem is that auth is log in me with no problem. There is always "success" when I pass correct login and password. But after that I redirect user to account and controller detects that user is not logged:
public function before() {
parent::before();
if (!Auth::instance()->logged_in()) {
HTTP::redirect('/User/login');
}
}
Even if I use redirect to homepage I am still not logged in. It looks like session data is lost. Strange is that it was working for a long time and suddenly a day ago it stopped.
Many thanks for any advices!