diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index 75cedc0328b..cbd7fd03239 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -324,7 +324,7 @@ you switch users, add an event subscriber on this event:: { $request = $event->getRequest(); - if ($request->hasSession() && ($session = $request->getSession)) { + if ($request->hasSession() && ($session = $request->getSession())) { $session->set( '_locale', // assuming your User has some getLocale() method