---
title: sameSitePolicy
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/httpcookie/samesitepolicy
---

# sameSitePolicy

A Boolean value that indicates whether to restrict the cookie to requests sent back to the same site that created it.

## Declaration

```swift
var sameSitePolicy: HTTPCookieStringPolicy? { get }
```

## Discussion

Discussion Along with the policy values defined by HTTPCookieStringPolicy, this property may also be nil. In this case, cross-site requests include the cookie.

## See Also

### Securing cookies

- [isHTTPOnly](foundation/httpcookie/ishttponly.md)
- [isSecure](foundation/httpcookie/issecure.md)
- [HTTPCookieStringPolicy](foundation/httpcookiestringpolicy.md)
