---
title: HTTPCookieStringPolicy
framework: foundation
role: symbol
role_heading: Structure
path: foundation/httpcookiestringpolicy
---

# HTTPCookieStringPolicy

Values that indicate whether to restrict the cookie to requests sent back to the same site that created it.

## Declaration

```swift
struct HTTPCookieStringPolicy
```

## Discussion

Discussion RFC 6265 defines “same site” as the registerable domain of a URI.

## Topics

### Creating a policy

- [init(rawValue:)](foundation/httpcookiestringpolicy/init(rawvalue:).md)

### Policies

- [sameSiteStrict](foundation/httpcookiestringpolicy/samesitestrict.md)
- [sameSiteLax](foundation/httpcookiestringpolicy/samesitelax.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Securing cookies

- [isHTTPOnly](foundation/httpcookie/ishttponly.md)
- [isSecure](foundation/httpcookie/issecure.md)
- [sameSitePolicy](foundation/httpcookie/samesitepolicy.md)
