public function updateSessionReferrer(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $server = $event
            ->getRequest()
            ->server;

        $referrer = parse_url($server->get('HTTP_REFERER', false), PHP_URL_HOST);
        $host = parse_url($server->get('HTTP_HOST'), PHP_URL_HOST);

        if (
            ($referrer != $host) &&
            ($referrer !== false)
        ) {
            $event
                ->getRequest()
                ->getSession()
                ->set('referrer', $referrer);
        }
    }
public function updateSessionReferrer(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $server = $event
            ->getRequest()
            ->server;

        $referrer = parse_url($server->get('HTTP_REFERER', false), PHP_URL_HOST);
        $host = parse_url($server->get('HTTP_HOST'), PHP_URL_HOST);

        if (
            ($referrer != $host) &&
            ($referrer !== false)
        ) {
            $event
                ->getRequest()
                ->getSession()
                ->set('referrer', $referrer);
        }
    }
public function updateSessionReferrer ( GetResponseEvent $ event ) { if ( ! $ event -> isMasterRequest ( ) ) { return ; } $ server = $ event -> getRequest ( ) -> server ; $ referrer = parse_url ( $ server -> get ( 'HTTP_REFERER' , false ) , PHP_URL_HOST ) ; $ host = parse_url ( $ server -> get ( 'HTTP_HOST' ) , PHP_URL_HOST ) ; if ( ( $ referrer != $ host ) && ( $ referrer !== false ) ) { $ event -> getRequest ( ) -> getSession ( ) -> set ( 'referrer' , $ referrer ) ; } }
Update referrer from session.

@param GetResponseEvent $event Event
Update referrer from session .