As the title says, Laravel's function Auth::attempt() returns true in the following code section (with unimportant parts deleted):
public function doLogin()
{
$validator = [..]
if ($validator->fails()) {
[..]
} else {
$userdata = array(
'username' => Input::get('username'),
'password' => Input::get('password')
);
if (Auth::attempt($userdata, true)) {
return Redirect::to('/');
} else {
return Redirect::to('login');
}
}
}
But when we are redirected, we try to check if an user is really logged in with Auth::check(), and it returns false somehow.
We have tried every possible solution on Google and did not succeed with any of it. For example we added a remember_token but it did not change anything, though it proved us that the Auth::attempt() does something because the remember_token is set in the database.
As a last resort, we even tried to print something in the Auth::attempt() method of Laravel in ./vendor/laravel/framework/src/Illuminate/Auth/Guard.php but we did not see anything of that, not even with print_r. We tried to find other attempt-functions in the complete codebase but none is found.
It could be that something about changing User to an translated form of it makes it broken, but then the function Auth::attempt() should also be broken, probably.
It seems that something really magical happens but we have no idea what or how. Does anybody else have an idea?