src/Web/RequestHelper.php
protected function loadCookies()
    {
        $cookies = [];
        $cookiesSource = $this->reactRequest->getCookieParams();
        if ($this->enableCookieValidation) {
            if ($this->cookieValidationKey == '') {
                throw new InvalidConfigException(get_class($this) . '::cookieValidationKey must be configured with a secret key.');
            }
            foreach ($cookiesSource as $name => $value) {
                if (!is_string($value)) {
                    continue;
                }
                $data = Reaction::$app->security->validateData($value, $this->cookieValidationKey);
                if ($data === false) {
                    continue;
                }
                $data = @unserialize($data);
                if (is_array($data) && isset($data[0], $data[1]) && $data[0] === $name) {
                    $cookies[$name] = Reaction::create([
                        'class' => 'Reaction\Web\Cookie',
                        'name' => $name,
                        'value' => $data[1],
                        'expire' => null,
                    ]);
                }
            }
        } else {
            foreach ($cookiesSource as $name => $value) {
                $cookies[$name] = Reaction::create([
                    'class' => 'Reaction\Web\Cookie',
                    'name' => $name,
                    'value' => $value,
                    'expire' => null,
                ]);
            }
        }

        return $cookies;
    }
protected function loadCookies()
    {
        $cookies = [];
        $cookiesSource = $this->reactRequest->getCookieParams();
        if ($this->enableCookieValidation) {
            if ($this->cookieValidationKey == '') {
                throw new InvalidConfigException(get_class($this) . '::cookieValidationKey must be configured with a secret key.');
            }
            foreach ($cookiesSource as $name => $value) {
                if (!is_string($value)) {
                    continue;
                }
                $data = Reaction::$app->security->validateData($value, $this->cookieValidationKey);
                if ($data === false) {
                    continue;
                }
                $data = @unserialize($data);
                if (is_array($data) && isset($data[0], $data[1]) && $data[0] === $name) {
                    $cookies[$name] = Reaction::create([
                        'class' => 'Reaction\Web\Cookie',
                        'name' => $name,
                        'value' => $data[1],
                        'expire' => null,
                    ]);
                }
            }
        } else {
            foreach ($cookiesSource as $name => $value) {
                $cookies[$name] = Reaction::create([
                    'class' => 'Reaction\Web\Cookie',
                    'name' => $name,
                    'value' => $value,
                    'expire' => null,
                ]);
            }
        }

        return $cookies;
    }
Converts `$_COOKIE` into an array of [[Cookie]].
@return array the cookies obtained from request