Starts the session.

@return  bool  True if started.

@throws \RuntimeException If something goes wrong starting the session.
350855
public function start()
    {
        if ($this->isStarted()) {
            return true;
        }

        /*
         * Write and Close handlers are called after destructing objects since PHP 5.0.5.
         * Thus destructors can use sessions but session handler can't use objects.
         * So we are moving session closure before destructing objects.
         */
        session_register_shutdown();

        session_cache_limiter('none');

        if (!session_start()) {
            throw new \RuntimeException('Failed to start the session');
        }

        static::$started = true;

        return true;
    }
1083746
public function initiateLogin()
    {

        if (!$this->canInitiateLogin()) {
            throw new \RuntimeException(
            	'Unable to initiate login'
            );
        }

        $uri = $this->getAuthenticationUri();
        return $this->redirector->redirect($uri);

    }
1320889
protected function startSession()
    {
        if (@session_status() === \PHP_SESSION_ACTIVE) {
            throw new SessionNotStartedException('Session started already!');
        }

        if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
            throw new SessionNotStartedException(sprintf('Unable to start session, headers already sent by "%s" at line %d.', $file, $line));
        }

        $this->setSessionConfig();

        /*
         | We will start session, if fails
         | we will throw exception to user
         */
        if (!session_start()) {
            throw new SessionNotStartedException('Unable to start session');
        }
    }
837880
protected function start()
	{
		// Start session if not started
		if ($this->state == 'restart')
		{
			session_id($this->createId());
		}
		else
		{
			$session_name = session_name();

			if (!\Request::getVar($session_name, false, 'COOKIE'))
			{
				if ($id = \Request::getVar($session_name))
				{
					session_id($id);
					setcookie($session_name, '', time() - 3600);
				}
				else
				{
					session_id($this->createId());
				}
			}
		}

		session_cache_limiter('none');
		session_start();

		// Regenerate session id if passed a session id that no longer exists
		if ($_SESSION === array())
		{
			session_destroy();
			session_id($this->createId());
			session_start();
		}

		return true;
	}
767456
public function getSession(): ISession
    {
        if ($this->session === null) {
            if (!isset($this->implicit['session'])) {
                throw new \RuntimeException('The default session storage was not set');
            }
            $this->session = new Session($this->getCollector()->getSessionHandler($this->implicit['session']));
        }

        return $this->session;
    }
955291
public function sessionStart()
    {
        if ( $this->storage && !$this->storage->isStarted() )
        {
            $this->storage->start();
        }

        return true;
    }
824709
private function _start()
	{
		if ($this->_state === self::STATE_RESTART) {
			session_id($this->_createId());
		}

		session_cache_limiter('none');

		return session_start();
	}
529049
public function loadConfig()
    {
        $result = $this->configStorage->lock();
        if ($result === false) {
            throw new \RuntimeException('Failed to lock the configStorage');
        }
        try {
            $result = $this->configStorage->load();
        } catch (\RuntimeException $e) {
            $this->configStorage->clear();
            throw $e;
        } finally {
            $this->configStorage->unlock();
        }

        $this->config = $result;
        return true;
    }
809726
public function isStarted()
    {
        $started = \session_status() === PHP_SESSION_ACTIVE;

        // if the session was started externally, move the flash values forward
        if ($started && !$this->flashMoved) {
            $this->moveFlash();
        }

        // done
        return $started;
    }
1160653
public function send()
    {
        if (!$this->client) {
            throw new RuntimeException('A client must be set on the request');
        }

        if (null === $this->configuration->url) {
            $this->configuration->url = $this->getUrl()->toString();
        }
        $this->prepare();

        return $this->client->send($this);
    }
1210997
public function start()
    {
        $this->events->dispatch(new Events\ServerLaunching($this));

        $this->running = true;

        $this->dispatchEvent('Launching', $this);

        $result = $this->swooleServer->start();

        $this->running = false;

        return $result;
    }
410274
public function restart()
	{
		$this->destroy();

		if ($this->state !== 'destroyed')
		{
			// @TODO :: generated error here
			return false;
		}

		// Re-register the session handler after a session has been destroyed, to avoid PHP bug
		$this->store->register();

		$this->state = 'restart';

		// Regenerate session id
		$id = $this->createId();

		session_id($id);

		$this->start();
		$this->state = 'active';

		$this->validate();
		$this->setCounter();

		return true;
	}
1279745
private function startSession()
  {
    if (Config::has('session') && is_array($session = Config::get('session'))) {
      return session_start($session);
    }

    session_start([
      'name' => 'modulus_session'
    ]);
  }
350776
public function init()
    {
        $stream = @fopen($this->config['url'], 'a');
        if (!$stream) {
            throw new \RuntimeException(sprintf("Couldn't open resource '%s'", $this->config['url']));
        }

        $this->stream = $stream;

        if (!empty($this->config['lock']) && $this->config['lock'] === true && stream_supports_lock($this->stream)) {
            $this->useLocks = true;
        }
    }
1162186
public function start()
	{
		if(!self::$isStarted){
			$this->session();
			$this->setDefaultTimezone();
			$this->registerErrorhandler();
			self::$isStarted = true;
		}
	}
1224250
public function start()
    {
        if ($this->state === static::STATE_ACTIVE) {
            return true;
        }

        $this->doStart();

        if ($this->state === static::STATE_EXPIRED) {
            $this->restart();
        }

        return true;
    }
793082
public function start()
    {
        if (!$this->hasStarted()) {
            $this->setStarted();
            $this->dispatch(RunEvent::STARTED, new RunEvent($this));
            try {
                try {
                    $output = call_user_func($this->callback);
                    $this->handleOutput($output);
                    $this->setFinished();
                    $this->successful = true;
                    $this->dispatch(RunEvent::SUCCESSFUL, new RunEvent($this));
                } catch (Exception $e) {
                    $this->setFinished();
                    $this->successful = false;
                    $this->exception = $e;
                    $this->dispatch(RunEvent::FAILED, new RunEvent($this));
                } catch (Throwable $e) {
                    $this->setFinished();
                    $this->successful = false;
                    $this->exception = $e;
                    $this->dispatch(RunEvent::FAILED, new RunEvent($this));
                }
            } finally {
                $this->dispatch(RunEvent::COMPLETED, new RunEvent($this));
            }
        }

        return $this;
    }