Structure

HTTPCookieStringPolicy

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

Declaration

struct HTTPCookieStringPolicy

Overview

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

Topics

Creating a Policy

init(rawValue: String)

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

Policies

static let sameSiteStrict: HTTPCookieStringPolicy

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

static let sameSiteLax: HTTPCookieStringPolicy

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

Relationships

See Also

Securing Cookies

var isHTTPOnly: Bool

A Boolean value that indicates whether the cookie should only be sent to HTTP servers.

var isSecure: Bool

A Boolean value that indicates whether the cookie may only be sent over secure channels.

var sameSitePolicy: HTTPCookieStringPolicy?

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