yii\web\MultiFieldSession::extractData PHP Method

extractData() protected method

Extracts session data from storage field set.
protected extractData ( array $fields ) : string
$fields array storage fields.
return string session data.
    protected function extractData($fields)
    {
        if ($this->readCallback !== null) {
            if (!isset($fields['data'])) {
                $fields['data'] = '';
            }
            $extraData = call_user_func($this->readCallback, $fields);
            if (!empty($extraData)) {
                session_decode($fields['data']);
                $_SESSION = array_merge((array) $_SESSION, (array) $extraData);
                return session_encode();
            }
            return $fields['data'];
        } else {
            return isset($fields['data']) ? $fields['data'] : '';
        }
    }