# getSameSite

Learn how to read the cookie SameSite policy.

This method provides the SameSite policy of the cookie.

## Signature

This method has the following signature:

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

This method returns the SameSite policy of the cookie, or `null` when it is unset.

## Example

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

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

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