@param string $sessionId
@param string $data

@throws DatabaseException

@return bool
480547
public function write($sessionId, $data): bool
    {
        $sql = 'REPLACE INTO sessions VALUES(:id, :id_user, NOW(), :content)';
        $params = ['id' => $sessionId, 'id_user' => $this->userId, 'content' => $data];

        return $this->db->exec($sql, $params);
    }
537513
public function destroy($sessionId)
    {
        if (Config::get('session_user_loc') == 'db') {
            $this->handler->delete(Config::get('session_user_loc_table') . '-id-' . $sessionId, true, Config::get('session_user_loc_tableprefix'));
        } else {
            $this->handler->delete(Config::get('session_user_loc_tableprefix') . Config::get('session_user_loc_table') . '-id-' . $sessionId);
        }
        return true;
    }
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;
		}
	}
940911
public function write($sessionID, $sessionData, $maxLifeTime)
    {
        Coroutine::writeFile($this->getFileName($sessionID), $sessionData, LOCK_EX);
    }
21243
public function read($sessionId)
    {
        $sql = "SELECT {$this->options['data_col']} 
 FROM {$this->options['table']} 
 WHERE {$this->options['id_col']} = :id";

        try {
            $stmt = $this->db->prepare($sql);

            $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);

            $stmt->execute();

            // We use fetchAll instead of fetchColumn to make sure the DB cursor gets closed
            $sessionRows = $stmt->fetchAll(\PDO::FETCH_NUM);

            if ($sessionRows) {
                return base64_decode($sessionRows[0][0]);
            }

            return '';
        } catch (\PDOException $e) {
            throw new \RuntimeException(
                sprintf(
                    'PDOException was thrown when trying to read the session data: %s',
                    $e->getMessage()
                ),
                0,
                $e
            );
        }
    }
314188
public function write($session_id, $session_data)
	{
		$key = $this->key($session_id);

		if ($this->engine->get($key . '_expire'))
		{
			$this->engine->replace($key . '_expire', time());
		}
		else
		{
			$this->engine->set($key . '_expire', time());
		}
		if ($this->engine->get($key))
		{
			$this->engine->replace($key, $session_data);
		}
		else
		{
			$this->engine->set($key, $session_data);
		}

		return;
	}
478136
protected function doWrite($sessionId, $data)
    {
        $item = $this->getCacheItem($sessionId);
        $item->set($data)
            ->expiresAfter($this->ttl);

        return $this->cache->save($item);
    }
622617
public function read($sessionID): string
    {
        $where = ['session_id' => $sessionID];
        $query = $this->dbClass->prepare()->select(['session_data'])->from($this->dbTable)->where($where);
        $result = $this->dbClass->execute($query);
        $data = $this->dbClass->rowCount() > 0 ? $result[0]['session_data'] : '';

        return $data;
    }
1253679
public function destroy($session_id)
	{
		if (!$this->database->del($this->key($session_id)))
		{
			return false;
		}
		return true;
	}
589234
public function destroy($sessionId): bool
    {
        $sql = 'DELETE FROM sessions WHERE id = :id';
        $params = ['id' => $sessionId];
        $this->db->delete($sql, $params);

        return true;
    }
578968
private function _getSession($sessionId)
    {
        if (is_null($this->_session)) {
            $this->_session = $this->_repository->find(array('sessionId' => $sessionId));
        }

        return $this->_session;
    }
1211110
public function destroy($session_id)
	{
		// Get the database connection object and verify its connected.
		if (!$this->connection->connected())
		{
			return false;
		}

		try
		{
			$query = $this->connection->getQuery()
				->delete('#__session')
				->whereEquals('session_id', $session_id);

			// Remove a session from the database.
			$this->connection->setQuery($query->toString());

			return (boolean) $this->connection->execute();
		}
		catch (Exception $e)
		{
			return false;
		}
	}
1371873
public function initSessionData(string $sessionId): void
    {
        $data = [
            'uid' => 0,
            'session_data' => [],
            'expired_at' => time() + $this->sessionLife,
            'updated_at' => time()
        ];
        $this->isNew = true;
        $this->destroyed = false;
        $this->commited = false;
        if (($sessionId != '') && $this->checkSessionExists($sessionId)) {
            $this->isNew = false;
            $data = $this->loadSessionData($sessionId);
        } else {
            do {
                $sessionId = $this->makeSessionId();
            } while ($this->checkSessionExists($sessionId));
        }
        $attributes = [
            'uid' => $data['uid'],
            'expired_at' => $data['expired_at'],
            'updated_at' => $data['updated_at'],
            'session_id' => $sessionId
        ];
        $sessionData = $data['session_data'];
        $this->sessionAttributes = new ObserverData($attributes);
        $this->sessionData = new ObserverData($sessionData);
    }
1306471
public function destroy($sessionId) {
        try {
            $this->_tableRestProxy->deleteEntity($this->_sessionContainer, $this->_sessionContainerParition, $sessionId);
            return TRUE;
        } catch (ServiceException $e) {
            return FALSE;
        }
    }
88215
public function write($session_id, $session_data)
    {
        $saved = @file_put_contents($this->sessionFile($session_id), $session_data);

        return $saved !== false;
    }
727740
public function write($sessionid, $sessiondata)
    {
        $adapter = $this->getAdapter();

        $data = [
          'time' => time(),
          'data' => $sessiondata
        ];

        if ($adapter instanceof PostgreSQL) {
            $data['data'] = bin2hex($data['data']);
        }

        $sess = $this->getDbData($sessionid);

        if ($this->disableLog) {
            Log::temporaryDisable('sql');
        }

        if ($sess === null) {
            // the record doesn't exists in database, lets insert it
            $data['id'] = $sessionid;

            try {
                $adapter->insert($this->getTableName(), $data)->exec();
                return true;

            } catch (DbException $e) {
                Log::emergency($e);
                return false;

            } finally {
                if ($this->disableLog) {
                    Log::restoreTemporaryDisablement();
                }

            }

        } else {
            // the record data already exists in db

            try {
                $adapter->update($this->getTableName(), $data)->where('id', $sessionid)->exec();
                return true;

            } catch (DbException $e) {
                Log::emergency($e);
                return false;

            } finally {
                if ($this->disableLog) {
                    Log::restoreTemporaryDisablement();
                }

            }
        }
    }
1282045
public function write(string $sessionId, string $sessionData)
    {
        $key = "{$this->sessionName}_{$sessionId}";

        return $this->redis->set($key, $sessionData, $this->getConfig()->get('session.maxLifeTime', 1440));
    }