how about?

```
$this->get('security.context')->setToken(null);
$this->get('request')->getSession()->invalidate();
```