I’m use default login program in laravel 12.
It’s work very well before few day ago.
When I try to login my web, it will select user again and again event I delete my update in that day.
I’m listen my query, and log is like this.
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.14}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.15}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.16}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.16}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.16}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.15}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.15}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.14}
[2025-06-06 04:19:23] local.INFO: SQL Query {"sql":"select * from `users` where `id` = ? limit 1","bindings":[1],"time":0.15}
The most weird thing is this program is work at another computer.
I found that delete this line in SessionGuard.php will fix the problem, but $request->user() will be null.
protected function updateSession($id)
{
$this->session->put($this->getName(), $id); // delete this line
$this->session->migrate(true);
}
my login function in AuthenticatedSessionController
public function store(Request $request): RedirectResponse
{
$request->validate([
'email' => 'required|email',
'password' => 'required',
]);
$request->authenticateAccount(); // crash function
$request->user()->createToken('api');
return redirect('/homeManage');
}
crash function
public function authenticate(): bool
{
$result = $this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { // crash in this condition process
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
return $result;
}
Can someone tell me how to fix it?