/Security/Logout/FacebookHandler.php
http://github.com/FriendsOfSymfony/FOSFacebookBundle · PHP · 37 lines · 18 code · 6 blank · 13 comment · 0 complexity · bf5ff78ebd56d33cbb94cb1f1fa1056b MD5 · raw file
- <?php
- /*
- * This file is part of the FOSFacebookBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace FOS\FacebookBundle\Security\Logout;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
- use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
- /**
- * Listener for the logout action
- *
- * This handler will clear the application's Facebook cookie.
- */
- class FacebookHandler implements LogoutHandlerInterface
- {
- private $facebook;
- public function __construct(\BaseFacebook $facebook)
- {
- $this->facebook = $facebook;
- }
- public function logout(Request $request, Response $response, TokenInterface $token)
- {
- $response->headers->clearCookie('fbsr_'.$this->facebook->getAppId());
- }
- }