src/Web/Cookie.php
public function getForHeader($validationKey = null) {
        if ($this->expire != 1 && isset($validationKey)) {
            $value = \Reaction::$app->security->hashData(serialize([$this->name, $this->value]), $validationKey);
        }
        $value = isset($value) && $value !== "" ? urlencode($value) : '';
        $name = urlencode($this->name);
        $data = [
            'Secure' => $this->secure ? null : '',
            'HttpOnly' => $this->httpOnly ? null : '',
            'Domain' => isset($this->domain) ? $this->domain : '',
            'Path' => isset($this->path) ? $this->path : '',
            'Expires' => !empty($this->expire) ? gmdate('D, d M Y H:i:s T', $this->expire) : '',
        ];
        foreach ($data as $key => $val) {
            if ($val === '') {
                unset($data[$key]);
            }
        }
        $data = ArrayHelper::merge([$name => $value], $data);

        return $this->convertArrayToHeaderString($data);
    }
public function getForHeader($validationKey = null) {
        if ($this->expire != 1 && isset($validationKey)) {
            $value = \Reaction::$app->security->hashData(serialize([$this->name, $this->value]), $validationKey);
        }
        $value = isset($value) && $value !== "" ? urlencode($value) : '';
        $name = urlencode($this->name);
        $data = [
            'Secure' => $this->secure ? null : '',
            'HttpOnly' => $this->httpOnly ? null : '',
            'Domain' => isset($this->domain) ? $this->domain : '',
            'Path' => isset($this->path) ? $this->path : '',
            'Expires' => !empty($this->expire) ? gmdate('D, d M Y H:i:s T', $this->expire) : '',
        ];
        foreach ($data as $key => $val) {
            if ($val === '') {
                unset($data[$key]);
            }
        }
        $data = ArrayHelper::merge([$name => $value], $data);

        return $this->convertArrayToHeaderString($data);
    }
Get cookie for Set-Cookie header
@param string $validationKey Cookie validation key
@return string
@throws \Reaction\Exceptions\InvalidConfigException