# getDomain

Learn how to read the cookie domain.

This method provides the domain of the cookie.

## Signature

This method has the following signature:

```php
public function getDomain(): ?string
```

This method returns the domain of the cookie, or `null` when it is not scoped to one.

## Example

Here is a basic example of how to use this method:

```php
<?php
use Croct\Plug\CookieStorage;

$cookies = CookieStorage::fromGlobals()->getResponseCookies();
$domain = $cookies[0]->getDomain();
```
