<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/HTTPCookieStringPolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSHTTPCookieStringPolicy"
  },
  "title" : "HTTPCookieStringPolicy"
}
-->

# HTTPCookieStringPolicy

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

```
struct HTTPCookieStringPolicy
```

## Discussion

[RFC 6265](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00) defines “same site” as the registerable domain of a URI.

## Topics

### Creating a policy

[`init(rawValue:)`](/documentation/Foundation/HTTPCookieStringPolicy/init(rawValue:))

Creates an HTTP cookie string policy from the given raw string.

### Policies

[`sameSiteStrict`](/documentation/Foundation/HTTPCookieStringPolicy/sameSiteStrict)

A policy that prohibits a cross-site request from including the cookie.

[`sameSiteLax`](/documentation/Foundation/HTTPCookieStringPolicy/sameSiteLax)

A policy that allows certain cross-site requests to include the cookie.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)