Structurehummingbird 2.10.0Hummingbird
Properties
Cookie properties table
struct Properties
Cookie properties table
struct Properties
import Hummingbird
struct Cookie
Structure holding a single cookie
init(name: String, value: String, expires: Date? = nil, maxAge: Int? = nil, domain: String? = nil, path: String? = nil, secure: Bool = false, httpOnly: Bool = true)
Create Cookie
init(name: String, value: String, expires: Date? = nil, maxAge: Int? = nil, domain: String? = nil, path: String? = nil, secure: Bool = false, httpOnly: Bool = true, sameSite: SameSite)
Create Cookie
var description: String { get }
Output cookie string
var domain: String? { get }
specifies those hosts to which the cookie will be sent
var expires: Date? { get }
indicates the maximum lifetime of the cookie
var httpOnly: Bool { get }
The HttpOnly attribute limits the scope of the cookie to HTTP requests
var maxAge: Int? { get }
indicates the maximum lifetime of the cookie in seconds. Max age has precedence over expires (not all user agents support max-age)
let name: String
Cookie name
var path: String? { get }
The scope of each cookie is limited to a set of paths, controlled by the Path attribute
let properties: Properties
properties
var sameSite: SameSite? { get }
The SameSite attribute lets servers specify whether/when cookies are sent with cross-origin requests
var secure: Bool { get }
The Secure attribute limits the scope of the cookie to “secure” channels
let value: String
Cookie value
enum SameSite
protocol Sendable
subscript(string: Substring) -> String? { get set }