I'm looking for a way to log user out of Symfony 2 application, but could not find a way to do it properly.
I've tried an approach described here: Symfony2: how to log user out manually in controller?
$this->get('security.context')->setToken(null);
$this->get('request')->getSession()->invalidate();
It's working fine when "remember me" is disabled, however, when I enable it, it's not working. It looks like user is automatically re-authenticated back again by this cookie.
remember_me:
key: "%secret%"
lifetime: 31536000
path: /
domain: ~
always_remember_me: true
What is the proper way to log user out of Symfony 2 application? Do I need to additionally delete this cookie from server-side?