Write session data to the SessionHandler backend.

@param   string   $id    The session identifier.
@param   string   $data  The session data.
@return  boolean  True on success, false otherwise.
496691
public function write($session_id, $session_data)
	{
		$data = array(
			'session_id' => $session_id,
			'client_id'  => \App::get('client')->id,
			'guest'      => \User::isGuest(),
			'time'       => time(),
			'data'       => $session_data,
			'userid'     => \User::get('id'),
			'username'   => \User::get('username'),
			'usertype'   => null,
			'ip'         => $_SERVER['REMOTE_ADDR']
		);

		$saved = $this->database->hmset($this->key($session_id), $data);

		return $saved;
	}
1225273
public function write( $id, $data )
	{
	    \CCJson::write( $this->file_path( $id ), $data, true );
	}
400701
function write($id,$data) {
		$this->set('session_id',$id);
		$this->set('data',$data);
		$this->set('ip',$this->_ip);
		$this->set('agent',$this->_agent);
		$this->set('stamp',time());
		$this->save();
		return TRUE;
	}
606866
public function write($id, $data)
	{
		$tableName = $this->db->parseField($this->tableName);
		$sessionIDField = $this->db->parseField('session_id');
		$dataField = $this->db->parseField('data');
		$updateTimeField = $this->db->parseField('update_time');
		$result = $this->db->query(<<<SQL
select * from {$tableName} where {$sessionIDField} = %s
SQL
,array($id));
		$updateTime = time();
		if(isset($result['session_id']))
		{
			return $this->db->execute(<<<SQL
update {$tableName} set {$dataField} = %s,{$updateTimeField} = %s where {$sessionIDField} = %s
SQL
,array($data,$updateTime,$id));
		}
		else
		{
			return $this->db->execute(<<<SQL
insert into {$tableName}({$sessionIDField},{$dataField},{$updateTimeField}) values(%s,%s,%s)
SQL
,array($id,$data,$updateTime));
		}
	}
988490
public function write(
        /*# string */ $session_id,
        /*# string */ $session_data
    )/*# : bool */ {
        $file = $this->getSessionFile($session_id);
        return file_put_contents($file, $session_data) !== false;
    }
32222
public function write($id, $data): bool
    {
        DB::table('session')->updateOrInsert([
            'session_id' => $id,
        ], [
            'session_time' => Carbon::now(),
            'user_id'      => (int) Auth::id(),
            'ip_address'   => $this->request->getServerParams()['REMOTE_ADDR'] ?? '127.0.0.1',
            'session_data' => $data,
        ]);

        return true;
    }
441425
function write($id,$data) {
		$fw=Base::instance();
		$sent=headers_sent();
		$headers=$fw->get('HEADERS');
		$csrf=$fw->hash($fw->get('ROOT').$fw->get('BASE')).'.'.
			$fw->hash(mt_rand());
		$jar=$fw->get('JAR');
		if ($id!=$this->sid)
			$this->sid=$id;
		Cache::instance()->set($id.'.@',
			array(
				'data'=>$data,
				'csrf'=>$sent?$this->csrf():$csrf,
				'ip'=>$fw->get('IP'),
				'agent'=>isset($headers['User-Agent'])?
					$headers['User-Agent']:'',
				'stamp'=>time()
			),
			$jar['expire']?($jar['expire']-time()):0
		);
		return TRUE;
	}
655890
public function session_write($sessionId, $sessionData)
    {
        $sessionData       = (!$sessionData || !is_array($sessionData)) ? [] : $sessionData;
        $this->sessionData = (!$this->sessionData) ? [] : $this->sessionData;

        $this->sessionData = array_merge($sessionData, $this->sessionData);
        $this->engine->set($this->sessionKey . $sessionId, $this->sessionData, $this->sessionLifeTime);

        return true;
    }
1360291
function write($id,$data) {
		$fw=Base::instance();
		$jar=$fw->JAR;
		$this->_cache->set($id.'.@',
			[
				'data'=>$data,
				'ip'=>$this->_ip,
				'agent'=>$this->_agent,
				'stamp'=>time()
			],
			$jar['expire']
		);
		return TRUE;
	}
1114629
public function write($id, $data)
    {
        //dane nie uległy zmianie
        if ($data == $this->_data) {
            return true;
        }
        //niepoprawne ID
        if (!$this->_validate($id)) {
            return true;
        }
        //wyszukiwanie rekordu
        if (null === $record = (new Orm\SessionQuery)->findPk($id)) {
            //tworzenie nowego rekordu
            $record = new Orm\SessionRecord;
        }
        //puste dane sesyjne
        if (!$data) {
            //jeśli istniał rekord - usuwamy
            $record->id ? $record->delete() : null;
            return true;
        }
        //ustawianie danych i czasu
        $record->id = $id;
        $record->data = $data;
        $record->timestamp = time();
        //zapis rekordu
        return $record->save();
    }
1207254
public function write($id, $data)
    {
        return $this->getCache()->save(
            $data, 
            $this->normalizeId($id), 
            array(), 
            \Zend_Session::getOptions('gc_maxlifetime')
        );
    }
810133
public function write(string $id, array $data) : bool
    {
        static $create, $update, $delete;
        $values = $data + compact('id'); // Default.
        unset($values['dateactive']);
        if (!isset($create, $update)) {
            $fields = [];
            $placeholders = [];
            $updates = [];
            foreach ($values as $key => &$value) {
                if ($key == 'data') {
                    $value = base64_encode($value);
                }
                $fields[] = $key;
                $placeholders[] = ":$key";
                if ($key != 'id') {
                    $updates[] = "$key = :$key";
                }
            }
            $create = $this->pdo->prepare(sprintf(
                "INSERT INTO cesession_session (%s) VALUES (%s)",
                implode(', ', $fields),
                implode(', ', $placeholders)
            ));
            $update = $this->pdo->prepare(sprintf(
                "UPDATE cesession_session SET %s WHERE id = :id",
                implode(', ', $updates)
            ));
            $delete = $this->pdo->prepare("DELETE FROM cesession_session WHERE id = :id");
        }
        if ($this->exists) {
            $update->execute($values);
            return (bool)$update->rowCount();
        } else {
            $delete->execute(compact('id'));
            try {
                $create->execute($values);
                return ($affectedRows = $create->rowCount()) && $affectedRows;
            } catch (PDOException $e) {
                $update->execute($values);
                return (bool)$update->rowCount();
            }
        }
    }
418785
public function write($id, $data)
    {
        $data = [
            $this->options['data_col'] => $data,
            $this->options['time_col'] => (int) time(),
            $this->options['id_col'] => $id,
        ];

        $data = (object) $data;

        $this->db->updateObject($this->options['table'], $data, $this->options['id_col']);

        if ($this->db->getAffectedRows()) {
            return true;
        }

        $this->db->insertObject($this->options['table'], $data, $this->options['id_col']);

        return true;
    }
1323194
public function write($id, $sessionData)
    {
        $this->repository->set("{$this->prefix}{$id}", $sessionData, $this->maxLifetime / 60);
        return true;
    }
64301
public function update($id, $data)
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $mode = $routeMatch->getParam('mode', false);
        $type = $routeMatch->getParam('type', false);
        $endpoint = $routeMatch->getParam('endpoint', false);
        $annee = $routeMatch->getParam('annee', 0);
        
        $processStateHandler = $this->getProcessStateHandler();
        $process = $processStateHandler->getProcess($mode, $type, $endpoint, $annee);
        
        if (is_null($process)) {
            $process = $processStateHandler->getDefaultProcess($mode, $type, $endpoint, $annee);
            $processStateHandler->saveProcess($process);
        }
        if (array_key_exists('force-execution-stop', $data)) {
            $process->setInterrupted(true);
        } else {
            $active = array_key_exists('active', $data) && $data['active'] === 'true';
            $process->setActive($active);
            $shedule = $data['shedule'] === 'true' && $data['active'] === 'true';
            $process->setShedule($shedule);
            $process->setCron($shedule ? $data['cron'] : null);
        }
        
        $processStateHandler->saveProcess($process);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $processJson = $serializer->serialize($process, 'json');
        $response->setContent($processJson);
        return $response;
    }
1098135
public function writeSession($id,$data)
	{
		return $this->_cache->set($this->calculateKey($id),$data,$this->getTimeout());
	}
443246
public function write($id, $data)
    {
        $data = base64_encode($data);
        $data = array(
            $this->options->getModifiedColumn() => time(),
            $this->options->getDataColumn()     => (string) $data,
        );

        $rows = $this->tableGateway->select(array(
            $this->options->getIdColumn()   => $id,
            $this->options->getNameColumn() => $this->sessionName,
        ));

        if ($row = $rows->current()) {
            return (bool) $this->tableGateway->update($data, array(
                $this->options->getIdColumn()   => $id,
                $this->options->getNameColumn() => $this->sessionName,
            ));
        }
        $data[$this->options->getLifetimeColumn()] = $this->lifetime;
        $data[$this->options->getIdColumn()]       = $id;
        $data[$this->options->getNameColumn()]     = $this->sessionName;

        return (bool) $this->tableGateway->insert($data);
    }