Permalink
Browse files

Move remember me ResponseListener from security bundle into security …

…component

This move allows to implement the remember me feature in Silex without having to reference the security bundle.
  • Loading branch information...
1 parent 44a9fea commit f17200e6b63c398dfd74a7f7435e86d331c4e4be @DerManoMann DerManoMann committed Aug 29, 2012
Showing with 1 addition and 35 deletions.
  1. +0 −34 EventListener/ResponseListener.php
  2. +1 −1 Resources/config/security_rememberme.xml
@@ -1,34 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Bundle\SecurityBundle\EventListener;
-
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;
-
-/**
- * Adds remember-me cookies to the Response.
- *
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
- */
-class ResponseListener
-{
- public function onKernelResponse(FilterResponseEvent $event)
- {
- $request = $event->getRequest();
- $response = $event->getResponse();
-
- if ($request->attributes->has(RememberMeServicesInterface::COOKIE_ATTR_NAME)) {
- $response->headers->setCookie($request->attributes->get(RememberMeServicesInterface::COOKIE_ATTR_NAME));
- }
- }
-}
@@ -13,7 +13,7 @@
<parameter key="security.authentication.rememberme.services.persistent.class">Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices</parameter>
<parameter key="security.authentication.rememberme.services.simplehash.class">Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices</parameter>
- <parameter key="security.rememberme.response_listener.class">Symfony\Bundle\SecurityBundle\EventListener\ResponseListener</parameter>
+ <parameter key="security.rememberme.response_listener.class">Symfony\Component\Security\Http\RememberMe\ResponseListener</parameter>
</parameters>
<services>

0 comments on commit f17200e

Please sign in to comment.