Your code is subscribing to a kernel event dispatched on every request. Try static function getSubscribedEvents() { $events['mymodule_user_login'][] = ['onUserLoginCallback', 1]; return $events; } BTW the dispatching code is deprecated. In Drupal 9 or higher swap both arguments: $event_dispatcher->dispatch($event, 'mymodule_user_login');