---
title: domain
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/httpcookiepropertykey/domain
---

# domain

An NSString object containing the domain for the cookie.

## Declaration

```swift
static let domain: HTTPCookiePropertyKey
```

## Discussion

Discussion If this cookie attribute is missing, the domain is inferred from the value for NSHTTPCookieOriginURL. If you do not specify a value for NSHTTPCookieOriginURL, you must specify a value for NSHTTPCookieDomain.

## See Also

### Cookie property keys

- [comment](foundation/httpcookiepropertykey/comment.md)
- [commentURL](foundation/httpcookiepropertykey/commenturl.md)
- [discard](foundation/httpcookiepropertykey/discard.md)
- [expires](foundation/httpcookiepropertykey/expires.md)
- [maximumAge](foundation/httpcookiepropertykey/maximumage.md)
- [name](foundation/httpcookiepropertykey/name.md)
- [originURL](foundation/httpcookiepropertykey/originurl.md)
- [path](foundation/httpcookiepropertykey/path.md)
- [port](foundation/httpcookiepropertykey/port.md)
- [sameSitePolicy](foundation/httpcookiepropertykey/samesitepolicy.md)
- [secure](foundation/httpcookiepropertykey/secure.md)
- [value](foundation/httpcookiepropertykey/value.md)
- [version](foundation/httpcookiepropertykey/version.md)
