Initializerasync-http-client 1.23.0AsyncHTTPClient
init(name:value:path:domain:expires:maxAge:httpOnly:secure:)
Create HTTP cookie.
FoundationExtensions.swift:42init(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.
Other members in extension
Type members
init?(header: String, defaultDomain: String
) Create a Cookie by parsing a
Set-Cookie
header.
Instance members
var domain: String?
The domain of the cookie.
var expires: Date?
The cookie’s expiration date.
var httpOnly: Bool
Whether the cookie should only be sent to HTTP servers.
var maxAge: Int?
The cookie’s age in seconds.
var name: String
The name of the cookie.
var path: String
The cookie’s path.
var secure: Bool
Whether the cookie should only be sent over secure channels.
var value: String
The cookie’s string value.