vendor/symfony/src/Symfony/Component/Security/Http/Logout/SessionLogoutHandler.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Symfony package.
       
     5  *
       
     6  * (c) Fabien Potencier <fabien@symfony.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Symfony\Component\Security\Http\Logout;
       
    13 
       
    14 use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
       
    15 use Symfony\Component\HttpFoundation\Response;
       
    16 use Symfony\Component\HttpFoundation\Request;
       
    17 
       
    18 /**
       
    19  * Handler for clearing invalidating the current session.
       
    20  *
       
    21  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
       
    22  */
       
    23 class SessionLogoutHandler implements LogoutHandlerInterface
       
    24 {
       
    25     /**
       
    26      * Invalidate the current session
       
    27      *
       
    28      * @param Request        $request
       
    29      * @param Response       $response
       
    30      * @param TokenInterface $token
       
    31      * @return void
       
    32      */
       
    33     public function logout(Request $request, Response $response, TokenInterface $token)
       
    34     {
       
    35         $request->getSession()->invalidate();
       
    36     }
       
    37 }