session->set('authenticated', true); $this->session->set('user', $user->toArray()); } public function clearUserAuthenticatedState(): void { $this->session->delete('authenticated'); $this->session->delete('user'); } }