symfony/symfony — pull request #3007 by jmikola (2011-12-31 07:45:29+00:00)
Title: [Security] Implement support for CSRF tokens in logout URL's

This derived from #3006 but properly targeting on the master branch.

```
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

This exposes new configuration options to the logout listener to enable CSRF protection, as already exists for the form login listener. The individual commits and their extended messages should suffice for explaining the logical changes of the PR.

In addition to changing LogoutListener, I also created a templating helper to generate logout URL's, which includes a CSRF token if necessary. This may or may not using routing, depending on how the listener is configured since both route names or hard-coded paths are valid options.

Additionally, I added unit tests for LogoutListener and functional tests for both CSRF-enabled form logins and the new logout listener work. Lastly, this commit includes a cherry-pick of 60ebaaad70e6d7b8e280f34730973ee29c4c559d from the master branch.