public function handle(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $application = $event->getKernel()->getApplication();

        if (null !== $application && false === $request->hasSession()) {
            $container = $application->getContainer();
            $event->getRequest()->setSession($container->get('bb_session'));
        }

        parent::handle($event);
    }
public function handle(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $application = $event->getKernel()->getApplication();

        if (null !== $application && false === $request->hasSession()) {
            $container = $application->getContainer();
            $event->getRequest()->setSession($container->get('bb_session'));
        }

        parent::handle($event);
    }
public function handle ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; $ application = $ event -> getKernel ( ) -> getApplication ( ) ; if ( null !== $ application && false === $ request -> hasSession ( ) ) { $ container = $ application -> getContainer ( ) ; $ event -> getRequest ( ) -> setSession ( $ container -> get ( 'bb_session' ) ) ; } parent :: handle ( $ event ) ; }
Initiate session if not available then reads the SecurityContext from it.

@param GetResponseEvent $event A GetResponseEvent instance
Initiate session if not available then reads the SecurityContext from it .