Write a session to DynamoDB.

@param string $id   Session ID.
@param string $data Serialized session data to write.

@return bool Whether or not the operation succeeded.
437729
public function write($id, $data)
    {
        $changed = $id !== $this->openSessionId
            || $data !== $this->dataRead;
        $this->openSessionId = $id;

        // Write the session data using the selected locking strategy
        $this->sessionWritten = $this->connection
            ->write($this->formatId($id), $data, $changed);

        return $this->sessionWritten;
    }
338545
public function save($id, $data)
    {
        $id = $this->uniqId + '-' + $id;
        if (!$this->apcIsEnabled()) {
            return false;
        }

        if (!$this->contains($id)) {
            if ($this->debug) {
                $this->cache->save($id, $data, 100);
            } else {
                $this->cache->save($id, $data);
            }

            return true;
        }

        return false;
    }
254688
public function write($id, $data)
    {
        $session = \Doctrine::getTable($this->_tableName)->find($id);
        if (false === $session) {
            $session = new $this->_tableName();
            $session->{$this->_primaryKeyColumn} = $id;
        }

        $session->{$this->_dataColumn} = $data;
        $session->{$this->_lifetimeColumn} = $this->_lifetime;
        $session->{$this->_modifiedColumn} = time();

        if ($session->save()) {
            return true;
        }

        return false;
    }
62219
public function write($id, $data)
    {
        $session = $this->entityManager->find($this->entityManager, $id);
        if (null === $session) {
            $session = new $this->entityName();
            $session->{$this->primaryKeyColumn} = $id;
        }

        $session->{$this->dataColumn} = $data;
        $session->{$this->lifetimeColumn} = $this->lifetime;
        $session->{$this->modifiedColumn} = time();
        $this->entityManager->persist($session);

        try {
            $this->entityManager->flush();
            return true;
        } catch (\Doctrine\ORM\OptimisticLockException $exc) {
            return false;
        }
    }
857275
public function update($id, array $data)
    {
        $istance = $this->getById($id);

        if (! $istance)
        {
            return false;
        }

        return $istance->update($data);
    }
257557
public function write( $id, $data )
	{
		$columns = array();
		
		foreach( $this->index_fields as $field ) 
		{
			$columns[$field] = $data[$field]; unset( $data[$field] );
		}
		
		$columns['content'] = serialize( $data );
		
		// When the session id didnt change we will do an update
		if ( $id == $this->inital_session_id )
		{
			// because the we might already be in the shutdown process we 
			// have to forward sql error directly to CCError
			try {
				\DB::update( $this->table, $columns )
					->where( 'id', $id )
					->run( $this->database );
			} catch ( \Exception $e ) 
			{
				\CCError::exception( $e );
			}
		}
		else
		// else insert a new one
		{
			// add the id to the columns
			$columns['id'] = $id;
			
			// because the we might already be in the shutdown process we 
			// have to forward sql error directly to CCError
			try {
				\DB::insert( $this->table, $columns )->run( $this->database );
			} catch ( \Exception $e ) 
			{
				\CCError::exception( $e );
			}	
		}
	}
1322659
public function write($id, $data)
    {
        if (!$id) {
            return false;
        }

        return (bool)Cache::write($id, $data, $this->_options['config']);
    }
102745
protected function insertById($id, $data)
    {
        $fieldList = array_keys($data);
        $SQL = array(
            'INSERT INTO ' . $this->table,
            '(`' . implode('`, `', $fieldList) . '`) VALUES',
            '(:' . implode(', :', $fieldList) . ');'
        );
        $this->execute($SQL, $this->getBindParams($id, $data));
        return $SQL->getLastInsertId();
    }
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;
	}
1018782
public function write($id, $data)
    {
        // Only store session to disk if data exists or session already
        // existed before (in last case we always want to touch the file
        // to prevent early garbage collection)
        // Note: This logic can be overwritten by the force flag
        if ($data
            || $this->exists
            || $this->force
        ) {
            $file = $this->getPathForSessionId($id);
            file_put_contents($file, $data);
            chmod($file, 0600);
            $this->exists = true;
        }

        return true;
    }
926457
public function add(string $id, array $data = []): bool
    {
        try {
            $this->setFile($id);
            if ($this->file) {

                if (!file_exists($this->file)) {
                    //Novo
                    if($this->versionamento) {
                        $data['created'] = strtotime("now");
                        $data['updated'] = strtotime("now");
                        parent::deleteVerion($this->file);
                    }

                    $f = fopen($this->file, "w+");
                    fwrite($f, json_encode($data));
                    fclose($f);

                    return true;
                }
            }
            return false;
        } catch (\Exception $e) {
            return false;
        }
    }
680926
public function write( $id, $data, $next ) {
		$item       = new Option( $data );
		$session_id = $this->sanitize( $id );
		add_option( "_wp_session_{$session_id}", $item->data, '', 'no' );
		add_option( "_wp_session_expires_{$session_id}", $item->time, '', 'no' );

		return $next( $id, $data );
	}
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);
    }
1296399
public function pub($id, $data)
    {
        if (!isset($this->events[$id])) {
            return false;
        }
        return $this->events[$id]->pub($data);
    }
704166
function save($id, $data)
    {
        $data['_id'] = $id;
        $data['__meta']['sid'] = $this->sid;
        $this->collection->insertOne($data);
    }
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;
    }
306404
public function write($session_id, $session_data)
    {
        $this->sessions[$session_id] = [
            'time' => $this->createTimestamp(),
            'data' => $session_data
        ];

        return true;
    }