init(name:value:path:domain:expires:maxAge:httpOnly:secure:)

Create HTTP cookie.

FoundationExtensions.swift:42
init(name: String, value: String, path: String = "/", domain: String? = nil, expires: Date? = nil, maxAge: Int? = nil, httpOnly: Bool = false, secure: Bool = false)

Parameters

name

The name of the cookie.

value

The cookie’s string value.

path

The cookie’s path.

domain

The domain of the cookie, defaults to nil.

expires

The cookie’s expiration date, defaults to nil.

maxAge

The cookie’s age in seconds, defaults to nil.

httpOnly

Whether this cookie should be used by HTTP servers only, defaults to false.

secure

Whether this cookie should only be sent using secure channels, defaults to false.