diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml
index 10b503b6bf96..c8e5d9d5a093 100644
--- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml
+++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml
@@ -54,7 +54,7 @@
-
+
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php
index 626efd6a684f..b5e2b4848789 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php
@@ -11,6 +11,8 @@
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
+use Symfony\Component\BrowserKit\Cookie;
+
class LogoutTest extends AbstractWebTestCase
{
/**
@@ -62,11 +64,25 @@ public function testCsrfTokensAreClearedOnLogout(array $options)
*/
public function testAccessControlDoesNotApplyOnLogout(array $options)
{
- $client = $this->createClient($options + ['test_case' => 'LogoutAccess', 'root_config' => 'config.yml']);
+ $client = $this->createClient($options + ['test_case' => 'Logout', 'root_config' => 'config_access.yml']);
+
+ $client->request('POST', '/login', ['_username' => 'johannes', '_password' => 'test']);
+ $client->request('GET', '/logout');
+
+ $this->assertRedirect($client->getResponse(), '/');
+ }
+
+ public function testCookieClearingOnLogout()
+ {
+ $client = $this->createClient(['test_case' => 'Logout', 'root_config' => 'config_cookie_clearing.yml']);
+
+ $cookieJar = $client->getCookieJar();
+ $cookieJar->set(new Cookie('flavor', 'chocolate', strtotime('+1 day'), null, 'somedomain'));
$client->request('POST', '/login', ['_username' => 'johannes', '_password' => 'test']);
$client->request('GET', '/logout');
$this->assertRedirect($client->getResponse(), '/');
+ $this->assertNull($cookieJar->get('flavor'));
}
}
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/bundles.php
similarity index 100%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php
rename to src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/bundles.php
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/config.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/config_access.yml
similarity index 100%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/config.yml
rename to src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/config_access.yml
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/config_cookie_clearing.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/config_cookie_clearing.yml
new file mode 100644
index 000000000000..f62cc616557a
--- /dev/null
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/config_cookie_clearing.yml
@@ -0,0 +1,27 @@
+imports:
+- { resource: ./../config/framework.yml }
+
+security:
+ encoders:
+ Symfony\Component\Security\Core\User\User: plaintext
+
+ providers:
+ in_memory:
+ memory:
+ users:
+ johannes: { password: test, roles: [ROLE_USER] }
+
+ firewalls:
+ default:
+ form_login:
+ check_path: login
+ remember_me: true
+ require_previous_session: false
+ logout:
+ delete_cookies:
+ flavor: { path: null, domain: somedomain }
+ stateless: true
+
+ access_control:
+ - { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
+ - { path: .*, roles: IS_AUTHENTICATED_FULLY }
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/routing.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/routing.yml
similarity index 100%
rename from src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/routing.yml
rename to src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Logout/routing.yml