@param string $sessionid
@param string $sessiondata

@return bool
@throws \Koldy\Config\Exception
@throws \Koldy\Exception
@throws \Koldy\Filesystem\Exception
973398
public function write($sessionid, $sessiondata)
    {
        $wasWritten = !(file_put_contents("{$this->savePath}{$sessionid}.txt", $sessiondata) === false);

        if (!$wasWritten) {
            // maybe there's no folder on file system?

            if (!is_dir($this->savePath)) {
                Directory::mkdir($this->savePath, 0755);
                $wasWritten = !(file_put_contents("{$this->savePath}{$sessionid}.txt", $sessiondata) === false);
            }
        }

        return $wasWritten;
    }
259163
public function read($sessionId)
    {
        $sessionData = $this->_cache->get($sessionId);
        if (empty($sessionData) === false) {
            $this->_cache->set($sessionId, $sessionData, array('expiry' => $this->_sessionExpiryInterval));

            return $sessionData;
        }

        $sql    = 'SELECT SESSION_DATA FROM tbl_sessions where SESSION_ID=:SESSID';
        $select = $this->_db->prepare($sql);
        $select->execute(array(':SESSID' => $sessionId));
        $result = $select->fetchColumn();
        if (empty($result) === false) {
            $this->_cache->set($sessionId, $result, array('expiry' => $this->_sessionExpiryInterval));

            return $result;
        }

        return '';

    }
330571
protected function setSessionId($sessionId) {
    $session = ObjectFactory::getInstance('session');
    $sids = $session->get(self::SIDS_SESSION_VARNAME);
    $sids[$this->serverCli] = $sessionId;
    $session->set(self::SIDS_SESSION_VARNAME, $sids);
  }
1068163
private static function setSessionId($sessionId){
        $sessionId = trim($sessionId);

        // 非法字符处理
        if (!$sessionId || preg_match("/[^0-9a-z_\\-\\,]/i", $sessionId)) {
            return false;
        }

        $sessionId = substr($sessionId, 0, 40);
        session_id($sessionId);

        return $sessionId;
    }
650597
public function read($splash, $session, $sessionId)
    {

        $ini = new Ini();
        $store = $session->folder . DIRECTORY_SEPARATOR;

        //We need to know the array;
        if (!is_array($splash)) return false;

        $sfile = $store . $sessionId . ".ini";


        if (!$ini->isFile($sfile)) {
            //If we can't file the sessionf file;
            //throw new \Exception("The session file does not exists");
            return false;
        }

        //Temporarily chmode the file;
        $ini->chmod($sfile, 0755);

        if (!$ini->readParams($sfile)) {
            throw new \Exception("Could not read the session configuration file");
            return false;
        }

        $sess = $ini->getParams($sfile);

        if (!is_array($sess) || empty($sess)) {
            throw new \Exception("Invalid session file");
            return false;
        }

        //return data as an object;
        $object = new \stdClass;
        $object->session_id = $sessionId;
        $object->session_key = $sess['key'];
        $object->session_ip = $sess['ip'];
        $object->session_host = $sess['domain'];
        $object->session_agent = $sess['agent'];
        $object->session_token = $sess['token'];
        $object->session_expires = $sess['expiry'];
        $object->session_lastactive = $sess['active'];
        $object->session_registry = $sess['registry'];

        return $object;

    }
1323194
public function write($id, $sessionData)
    {
        $this->repository->set("{$this->prefix}{$id}", $sessionData, $this->maxLifetime / 60);
        return true;
    }
780233
function get_session_by_id($sessionid) {
        try {
            $param = new \Panopto\SessionManagement\GetSessionsById($this->auth, array($sessionid));
            $sessions = $this->smclient->GetSessionsById($param)->getGetSessionsByIdResult()->getSession();
        } catch (Exception $e) {
            return false;
        }
        if (count($sessions)) {
            return $sessions[0];
        }
        return false;
    }
795259
public function write($sessionId, $data)
    {
        $t = microtime(true);
        $expiration = $this->_lifeTime + time();
 
        //we store time of the db record expiration in the Memcache
        if ($this->_initSessionData !== $data) {
            Kwf_Registry::get('db')->query("REPLACE INTO kwf_sessions (sessionId, expiration, data) VALUES(?, ?, ?)", array($sessionId, $expiration, $data));
            $this->_memcacheSet($sessionId, $data);
        }
        Kwf_Benchmark::count('sessionhdl', 'read: '.((microtime(true)-$t)*1000).'ms');
        return true;
    }
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 '';
    }
45364
public function write($id, $session_data)
	{
        if ($id === '' && $session_data === '') {
            return false;
        }

        $result = false;
        $session = $this->_getSession($id);

        if (isset($session)) {
            $result = $session->set('meta', $session_data)->save();
        } else {
            $result = $this->_repository->getEntity()
            ->set('sessionId', $id)
            ->set('meta', $session_data)
            ->save();
        }

        if ($result) {
            $this->_data = $session_data;
        }

		return $result;
	}
541147
public function write($sessionId, $data): bool
    {
        $filename = $this->savePath . \DIRECTORY_SEPARATOR . $this->prefix . $sessionId;

        return \file_put_contents($filename, $data) === false ? false : true;
    }
530130
public function destroy($sessionId)
    {
        if ($this->_lock) {
            $query = $this->newQuery()
                ->where('id', $sessionId);
            if (!$query->delete()) {
                return $this->_fail();
            }
        }
        if ($this->close() === $this->_success) {
            $this->_cookie_destroy();
            return $this->_success;
        }

        return $this->_fail();
    }
233339
public static function singleton ($sessionID = FALSE)
	{
		
		// If no instance is set
		
		if (self::$_instance === FALSE)
		{
			
			// Create an instance
			
			self::$_instance	= new static ($sessionID);
			
		}
		
		// Return instance
		
		return self::$_instance;
		
	}
1306471
public function destroy($sessionId) {
        try {
            $this->_tableRestProxy->deleteEntity($this->_sessionContainer, $this->_sessionContainerParition, $sessionId);
            return TRUE;
        } catch (ServiceException $e) {
            return FALSE;
        }
    }
835848
public function write($sessionId, $sessionData){
        //si la sesión está abierta y tengo lock 
        if($this->opened){
            $sql= $this->connection->connection->prepare('REPLACE INTO sessions (session_id, session_data, session_expiration) VALUES(:id, :data, :expiration)');
            $sql->bindValue('id', $sessionId);
            $sql->bindValue('data', $sessionData);
            $fecha= new \DateTime();
            $fecha->add(new \DateInterval($this->expirationTime));
            $sql->bindValue('expiration', $fecha->format('Y-m-d H:i:s'));
            return $sql->execute() === TRUE;
        }
        else{
            return FALSE;
        }
    }
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;
		}
	}
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);
    }