yii\web\MultiFieldSession::composeFields PHP Method

composeFields() protected method

Composes storage field set for session writing.
protected composeFields ( string $id, string $data ) : array
$id string session id
$data string session data
return 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;
    }