src/Viserio/Component/Session/Middleware/StartSessionMiddleware.php
protected function startSession(ServerRequestInterface $request): StoreContract
    {
        $session   = $this->manager->getDriver();
        $cookies   = RequestCookies::fromRequest($request);

        $session->setId($cookies->has($session->getName()) ? $cookies->get($session->getName())->getValue() : '');

        foreach ($this->fingerprintGenerators as $fingerprintGenerator) {
            $session->addFingerprintGenerator(new $fingerprintGenerator($request));
        }

        if ($session->handlerNeedsRequest()) {
            $session->setRequestOnHandler($request);
        }

        if (! $session->open()) {
            $session->start();
        }

        return $session;
    }
protected function startSession(ServerRequestInterface $request): StoreContract
    {
        $session   = $this->manager->getDriver();
        $cookies   = RequestCookies::fromRequest($request);

        $session->setId($cookies->has($session->getName()) ? $cookies->get($session->getName())->getValue() : '');

        foreach ($this->fingerprintGenerators as $fingerprintGenerator) {
            $session->addFingerprintGenerator(new $fingerprintGenerator($request));
        }

        if ($session->handlerNeedsRequest()) {
            $session->setRequestOnHandler($request);
        }

        if (! $session->open()) {
            $session->start();
        }

        return $session;
    }
Start the session for the given request.

@param \Psr\Http\Message\ServerRequestInterface $request

@return \Viserio\Component\Contract\Session\Store