8000 implement EventSubscriberInterface into CookieTokenStorageListener · symfony/symfony@893fa0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 893fa0c

Browse files
committed
implement EventSubscriberInterface into CookieTokenStorageListener
1 parent a533b0e commit 893fa0c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Symfony/Component/Security/Csrf/TokenStorage/CookieTokenStorageListener.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\Security\Csrf\TokenStorage;
1313

1414
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
15+
use Symfony\Component\HttpKernel\KernelEvents;
16+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1517

1618
/**
1719
* Checks the request's attributes for a CookieTokenStorage instance. If one is
@@ -22,7 +24,7 @@
2224
*
2325
* @author Oliver Hoff <oliver@hofff.com>
2426
*/
25-
class CookieTokenStorageListener
27+
class CookieTokenStorageListener implements EventSubscriberInterface
2628
{
2729
/**
2830
* @var string
@@ -54,4 +56,14 @@ public function onKernelResponse(FilterResponseEvent $event)
5456
$headers->setCookie($cookie);
5557
}
5658
}
59+
60+
/**
61+
* {@inheritdoc}
62+
*/
63+
public static function getSubscribedEvents()
64+
{
65+
return array(
66+
KernelEvents::RESPONSE => array(array('onKernelResponse', 0)),
67+
);
68+
}
5769
}

0 commit comments

Comments
 (0)
0