yii\web\MultiFieldSession::composeFields PHP Méthode

composeFields() protected méthode

Composes storage field set for session writing.
protected composeFields ( string $id, string $data ) : array
$id string session id
$data string session data
Résultat array storage fields
    protected function composeFields($id, $data)
    {
        $fields = ['data' => $data];
        if ($this->writeCallback !== null) {
            $fields = array_merge($fields, call_user_func($this->writeCallback, $this));
            if (!is_string($fields['data'])) {
                $_SESSION = $fields['data'];
                $fields['data'] = session_encode();
            }
        }
        // ensure 'id' and 'expire' are never affected by [[writeCallback]]
        $fields = array_merge($fields, ['id' => $id, 'expire' => time() + $this->getTimeout()]);
        return $fields;
    }