i would like to do something like that in controller to log user out:
$user = $this->get('security.context')->getToken()->getUser(); $user->logOut();