framework/web/Request.php
public function getCookies()
    {
        if ($this->_cookies === null) {
            $this->_cookies = new CookieCollection($this->loadCookies(), [
                'readOnly' => true,
            ]);
        }

        return $this->_cookies;
    }
public function getCookies()
    {
        if ($this->_cookies === null) {
            $this->_cookies = new CookieCollection($this->loadCookies(), [
                'readOnly' => true,
            ]);
        }

        return $this->_cookies;
    }
Returns the cookie collection.

Through the returned cookie collection, you may access a cookie using the following syntax:

```php
$cookie = $request->cookies['name']
if ($cookie !== null) {
$value = $cookie->value;
}

// alternatively
$value = $request->cookies->getValue('name');
```

@return CookieCollection the cookie collection.