Any error message in your storage/logs file ? With more context maybe?
You can try adding Log::info in your handle method and see if that code is ever executed.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have login listener which should set one value to session after login.
EventServiceProvider.php (classes is imported)
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
Login::class => [
AddToSessionAfterLogin::class,
],
];
AddToSessionAfterLogin.php
public function handle(Login $event)
{
session(['user_id' => $event->user->id]);
}
Somehow login doesn't work any more. When I try to login, nothing happens and when I try again, I get.
Whoops! Something went wrong.
These credentials do not match our records.
I have flushed all caches and event dump autoload. Cleared browser cache and cookies. Still same. Any idea what's wrong here?
Thanks!
@markokaup so if you comment out the event, does it work? I doubt that this is what broke your login.
You can try commenting out the event, try also changing the key from user_id to something else.
Please or to participate in this conversation.