Nelmio\SecurityBundle\Session\CookieSessionHandler::onKernelResponse PHP Method

onKernelResponse() public method

public onKernelResponse ( FilterResponseEvent $e )
$e Symfony\Component\HttpKernel\Event\FilterResponseEvent
    public function onKernelResponse(FilterResponseEvent $e)
    {
        if (HttpKernelInterface::MASTER_REQUEST !== $e->getRequestType()) {
            return;
        }
        if ($this->logger) {
            $this->logger->debug('CookieSessionHandler::onKernelResponse - Get the Response object');
        }
        $this->request->getSession()->save();
        if ($this->cookie === false) {
            if ($this->logger) {
                $this->logger->debug('CookieSessionHandler::onKernelResponse - COOKIE not opened');
            }
            return;
        }
        if ($this->cookie === null) {
            if ($this->logger) {
                $this->logger->debug('CookieSessionHandler::onKernelResponse - CLEAR COOKIE');
            }
            $e->getResponse()->headers->clearCookie($this->cookieName);
        } else {
            $e->getResponse()->headers->setCookie($this->cookie);
        }
    }