Starts the session

@param Request $request The current request
171131
protected function startSession(Request $request)
    {
        $this->gc();
        $this->session->setId($request->getCookies()->get($this->session->getName()));
        $this->sessionHandler->open(null, $this->session->getName());
        $sessionVars = @unserialize($this->sessionHandler->read($this->session->getId()));

        if ($sessionVars === false) {
            $sessionVars = [];
        }

        $this->session->start($sessionVars);
    }
421471
public function start(Request $request, AuthenticationException $authException = null)
    {
        return new JsonResponse(['message' => $authException->getMessage()], Response::HTTP_UNAUTHORIZED);
    }
705766
private function startSession() {

        if (session_id() == "" || session_id() == null) {
            if (isset ($_REQUEST ["HTTPSESSID"])) {
                session_id($_REQUEST ["HTTPSESSID"]);
            }
            else if (isset ($_REQUEST ["PHPSESSID"])) {
                session_id($_REQUEST ["PHPSESSID"]);
            }
        }

        $cookieDomain = Configuration::instance()->getParameter('session.cookie.domain');
        if ($cookieDomain) {

            if ($cookieDomain == "WILDCARD") {
                $host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
                if ($host) {
                    $splitHost = explode(".", $host);
                    $tld = array_pop($splitHost);
                    $domain = array_pop($splitHost);
                    $cookieDomain = ".$domain.$tld";
                } else {
                    return;
                }
            }



            ini_set("session.cookie_domain", $cookieDomain);
        }

        @session_start();

    }
571539
public function prepare(InputRequest $request) {
		$routeOptions = $this->getOptions();
		if( !isset($routeOptions['session']) || $routeOptions['session'] ) {
			startSession();
		}
	}
688704
public function boot($request = null)
    {
        // Initialize application
        $this->getApp()->boot($request, $this->bootstrapRegistry->getItems());

        // Set base controller router
        Controller::setRouter($this->getRouter());

        // Include routes
        include_once $this->routesConfiguration->getRoutesPath($this->getApp()->getBasePath());
    }
1172553
public function run(SymfonyRequest $request = null)
	{
		$request = $request ?: $this['request'];

		$response = with($stack = $this->getStackedClient())->handle($request);

		$response->send();

		$stack->terminate($request, $response);
	}
224149
public function start(Request $request, AuthenticationException $authException = null)
    {
        $url = $this->getLoginUrl();

        return new RedirectResponse($url);
    }
142418
public function startAction(Request $request)
    {
        $data = json_decode($request->getContent(), true);

        $publicFile = $this->om->getObject($data['file'], PublicFile::class) ?? new PublicFile();

        $this->container->get('claroline.manager.api_manager')->import(
            $publicFile,
            $data['action'],
            $this->getLogFile($request)
        );

        //the following line doesn't work on our live server but it's supposed to be the proper way to do it
        //$this->async->run('claroline:api:load '.$publicFile->getId().' '.$data['action'].' '.$this->getLogFile($request));

        return new JsonResponse('started', 200);
    }
185883
public function mainAction(Request $request)
    {
        //====================================================================//
        // Setup Php Specific Settings
        ini_set('display_errors', 0);
        error_reporting(E_ERROR);
        define('SPLASH_SERVER_MODE', 1);
        //====================================================================//
        // Detect NuSOAP requests send by Splash Server
        $userAgent = $request->headers->get('User-Agent');
        if (is_string($userAgent) && (false !== strpos($userAgent, 'SOAP'))) {
            //====================================================================//
            // Create SOAP Server
            $server = new \SoapServer(
                dirname(__DIR__).'/Resources/wsdl/splash.wsdl',
                array('cache_wsdl' => WSDL_CACHE_NONE)
            );
            //====================================================================//
            // Register SOAP Service
            $server->setObject($this);
            //====================================================================//
            // Register shuttdown method available for fatal errors reteival
            register_shutdown_function(array(self::class, 'fatalHandler'));
            //====================================================================//
            // Prepare Response
            $response = new Response();
            $response->headers->set('Content-Type', 'text/xml; charset=ISO-8859-1');
            //====================================================================//
            // Execute Actions
            ob_start();
            $server->handle();
            $response->setContent(ob_get_clean());
            //====================================================================//
            // Return response
            return $response;
        }
        if (!empty($request->get('node')) && $this->get('splash.connectors.manager')->identify($request->get('node'))) {
            Splash::log()->deb('Splash Started In System Debug Mode');
            //====================================================================//
            // Setup Php Errors Settings
            ini_set('display_errors', 1);
            error_reporting(E_ALL);
            //====================================================================//
            // Output Server Analyze & Debug
            $html = SplashServer::getStatusInformations();
            //====================================================================//
            // Output Module Complete Log
            $html .= Splash::log()->getHtmlLogList();
//            $Html  .=   print_r(Splash::informations(), true);
            //====================================================================//
            // Return Debug Response
            return new Response($html);
        }
        //====================================================================//
        // Return Empty Response
        return new Response('This WebService Provide no Description.');
    }
702574
public function start(Request $request, AuthenticationException $authException = null)
    {
        return new RedirectResponse($this->server_login_url.'?'.$this->query_service_parameter.'='.urlencode($request->getUri()));
    }
294874
protected function beforeHandleRequest(HTTPRequest $request)
    {
        //Set up the internal dependencies (request, response)
        $this->setRequest($request);
        //Push the current controller to protect against weird session issues
        $this->pushCurrent();
        $this->setResponse(new HTTPResponse());
        //kick off the init functionality
        $this->doInit();
    }
771738
private function sessionStart()
    {
        if (session_status() !== PHP_SESSION_ACTIVE) {
            $request = new Request;
            session_set_cookie_params(
                0,
                $request->getBasePath(),
                null,
                $request->getUri()->getScheme() === 'https',
                true
            );
            session_start();
        }
    }
248807
public function execute(Request $request = null)
    {
        $request = $request ?: $this->request;

        $this->dispatcher->dispatch($request, $this->response);

    }
1210818
protected function authorize(Request $request)
    {
        $authorizer = $this->resolveAuthorizer($request);

        if ($authorizer) {
            $authorizer->authorize($this->getSubject());
        }
    }
1121062
private function startSession()
    {
        if ('' === session_id()) {
            // no session active
            session_set_cookie_params(
                $this->sessionOptions['lifetime'],
                $this->sessionOptions['path'],
                $this->sessionOptions['domain'],
                $this->sessionOptions['secure'],
                $this->sessionOptions['httponly']
            );
            session_start();
        }
    }
8633
public function getSession(Request $request)
    {
        return tap($this->manager->driver(), function (Session $session) use ($request) {
            $session->setId($request->cookies->get($session->getName()));
        });
    }
258648
public function init(HTTPRequest $request)
    {

        if (!$this->isStarted() && $this->requestContainsSessionId($request)) {
            $this->start($request);
        }

        // Funny business detected!
        if (isset($this->data['HTTP_USER_AGENT'])) {
            if ($this->data['HTTP_USER_AGENT'] !== $this->userAgent($request)) {
                $this->clearAll();
                $this->destroy();
                $this->started = false;
                $this->start($request);
            }
        }
    }