Refresh given session.

@param string $sessionId

@throws \eZ\Publish\Core\REST\Common\Exceptions\NotFoundException

@return \eZ\Publish\Core\REST\Server\Values\UserSession
968347
public function refreshSessionAction($sessionId, Request $request)
    {
        $session = $request->getSession();

        if ($session === null || !$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {
            $response = $this->authenticator->logout($request);
            $response->setStatusCode(404);

            return $response;
        }

        $this->checkCsrfToken($request);

        return new Values\UserSession(
            $this->repository->getCurrentUser(),
            $session->getName(),
            $session->getId(),
            $request->headers->get('X-CSRF-Token'),
            false
        );
    }
670759
public function refreshToken($tokenId) {

		$this->storage->removeToken($tokenId);

		$token = new CsrfToken(
			$tokenId,
			$this->generateValue((int) $this->tokenLength)
		);

		$this->storage->setToken($tokenId, $token);

		return $token;

	}
947204
public function insert($sessionId, $clientId)
	{
		$this->session_id = $sessionId;
		$this->client_id = $clientId;

		$this->time = time();
		$ret = $this->_db->insertObject($this->_tbl, $this, 'session_id');

		if (!$ret)
		{
			$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', strtolower(get_class($this)), $this->_db->stderr()));

			return false;
		}
		else
		{
			return true;
		}
	}
1138515
public function deleteSessionAction($sessionId, Request $request)
    {
        /** @var $session \Symfony\Component\HttpFoundation\Session\Session */
        $session = $request->getSession();
        if (!$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {
            $response = $this->authenticator->logout($request);
            $response->setStatusCode(404);

            return $response;
        }

        $this->checkCsrfToken($request);

        return new Values\DeletedUserSession($this->authenticator->logout($request));
    }
887041
public function startSession($user_id)
    {
        $this->deleteOldSessions();

        $user_id = (int)$user_id;
        $sid = $this->generateUserSid($user_id);

        $session = UsersSessionEntityRepository::findOneEntityByCriteria([
            'sid'     => $sid,
            'user_id' => $user_id,
        ]);
        if (!$session) {
            $session = new UsersSessionEntity();
        }
        $session->setSid($sid);
        $session->setUserId($user_id);
        $session->save();

        return $sid;
    }
374196
public function write(string $sessionId, string $sessionData)
    {
        return $this->getObject(\PG\MSF\Coroutine\File::class)->goWriteFile(
            "{$this->savePath}/{$this->sessionName}_{$sessionId}",
            $sessionData
        );
    }
324407
public function getUser($userId)
    {
        $response = $this->client->get(sprintf('/v2/user/%s', $userId));

        return new User($response);
    }
6798
public function read($sessionId)
    {
        $this->sessionExpired = false;

        $selectSql = $this->getSelectSql();
        $selectStmt = $this->db->query($selectSql)
                        ->bind(':id', $sessionId);

        $sessionRows = $selectStmt->row();

        if ($sessionRows) {
            if ($sessionRows->{$this->timeCol} + $sessionRows->{$this->lifetimeCol} < time()) {
                $this->sessionExpired = true;

                return '';
            }

            return is_resource($sessionRows->{$this->dataCol}) ? stream_get_contents($sessionRows->{$this->dataCol}) : $sessionRows->{$this->dataCol};
        }

        return '';
    }
1328865
public function read(string $sessionId)
    {
        $file = "{$this->savePath}/{$this->sessionName}_{$sessionId}";
        if (!is_file($file)) {
            return false;
        }

        return $this->getObject(\PG\MSF\Coroutine\File::class)->goReadFile($file);
    }
436324
public function load($id)
    {

        try {
            // prepare the pathname to the file containing the session data
            $filename = $this->getSessionSettings()->getSessionFilePrefix() . $id;
            $pathname = $this->getSessionSavePath($filename);

            // unpersist and return the session from the file system
            return $this->unpersist($pathname);

        } catch (SessionDataNotReadableException $sdnre) {
            $this->delete($id);
            throw $sdnre;
        }
    }
1192973
public function createPHPSession($sessionID = true)
    {
        if ($sessionID) {
            $_SESSION[$this->_sessionName] = $this->_session;
        }
        return $this;
    }
323707
public function Create ($sessionID = FALSE)
	{
		
		// If there is no session
		
		if (!session_id ())
		{
			
			// If there is a session ID
			
			if ($sessionID)
			{
				
				// Set it
				
				session_id ($sessionID);
				
			}
			
			// Start session
			
			session_start ();

		}

		
		// Send cache headers

		header ('Expires: Sun, 23 Nov 1984 03:13:37 GMT');
		header ('Last-Modified: ' . gmdate ('D, d M Y H:i:s') . ' GMT');
		header ('Cache-Control: no-store, no-cache, must-revalidate');
		header ('Cache-Control: post-check=0, pre-check=0', FALSE);
		header ('Pragma: no-cache');

		// Set session ID

		$this->_sessionID	= session_id ();
		
	}
145816
public function read($sessionId)
    {
        if ($this->get_lock($sessionId) !== false) {
            // Needed by write() to detect session_regenerate_id() calls
            if (!$this->_session_id) {
                $this->_session_id = $sessionId;
            }
            $query = $this->newQuery()
                ->select('timestamp', 'data')
                ->where('id', $sessionId);

            if ($this->_config['match_ip']) {
                $query->where('ip_address', $_SERVER['REMOTE_ADDR']);
            }

            if (($result = $query->first()) === null) {
                // PHP7 will reuse the same SessionHandler object after
                // ID regeneration, so we need to explicitly set this to
                // false instead of relying on the default ...
                if ($this->_session_id === $sessionId) {
                    $this->row_exists = false;
                }
                $this->_fingerprint = md5('');
                return '';
            }

            $this->row_exists = true;

            if ($result->timestamp < (time() - $this->_config['expiration'])) {
                $this->_fingerprint = md5('');
                return '';
            }
            $result = $result->data;
            $this->_fingerprint = md5($result);
            return $result;
        }
        $this->_fingerprint = md5('');
        return '';
    }
1283837
public function read($sessionId){
        //si la sesión está abierta y tengo lock 
        if($this->opened){
            $sql= $this->connection->connection->prepare('SELECT session_data FROM sessions WHERE session_id = :id');
            $sql->bindValue('id', $sessionId);
            $sql->execute();
            $result= $sql->fetch(\PDO::FETCH_ASSOC);
            if($result != NULL){
                return $result['session_data'];                
            }
            return '';
        }
        else{
            return '';
        }
    }
555476
public function refreshLastUsed($sessionId, $lastUsed = null)
    {
        if ($sessionInformation = $this->getSessionInformation($sessionId)) {
            if ($sessionInformation->getLastUsed() !== $lastUsed) {
                $sessionInformation->refreshLastUsed($lastUsed);
                $this->saveSessionInformation($sessionInformation);
            }
        }
    }
1171665
protected function doRead($sessionId): string
    {
        try {
            $this->sessionDataProvider = $this->getFacade()->get($this->prefix . $sessionId);
        } catch (RedisException $exception) {
            $this->sessionDataProvider->setData('');
        }

        return $this->sessionDataProvider->getData();
    }
959459
protected function getUser($userId = null)
    {
        if ($userId === null) {
            /** @var Token $sessionAuth */
            if ($this->session()->isStarted() && $sessionAuth = $this->session()->get('authentication')) {
                return $sessionAuth->getUser();
            }

            return false;
        }
        /** @var Repository\UsersRepository $repo */
        $repo = $this->storage()->getRepository(Entity\Users::class);

        return $repo->getUser($userId);
    }