NPRPC docs

struct CookieOptions

Swift

struct CookieOptions

Options controlling a Set-Cookie response header.

nprpc_swift/Sources/NPRPC/HttpAuth.swift:24

Constructors

init(httpOnly: Bool = true, secure: Bool = true, sameSite: String = "Strict", maxAge: Int? = nil, path: String = "/", domain: String = "")

Options with safe defaults: HttpOnly, Secure, SameSite=Strict, a session cookie scoped to the whole host.

nprpc_swift/Sources/NPRPC/HttpAuth.swift:41

Properties

var domain: String

Domain scope. Empty string = current host only (the default).

nprpc_swift/Sources/NPRPC/HttpAuth.swift:37

var httpOnly: Bool

Prevent JavaScript access (recommended for session tokens).

nprpc_swift/Sources/NPRPC/HttpAuth.swift:26

var maxAge: Int?

Lifetime in seconds. nil = session cookie (no Max-Age header).

nprpc_swift/Sources/NPRPC/HttpAuth.swift:33

var path: String

Path scope. Defaults to "/".

nprpc_swift/Sources/NPRPC/HttpAuth.swift:35

var sameSite: String

SameSite attribute — "Strict", "Lax", or "None". Use "None" together with secure = true for cross-site cookies.

nprpc_swift/Sources/NPRPC/HttpAuth.swift:31

var secure: Bool

Send only over HTTPS.

nprpc_swift/Sources/NPRPC/HttpAuth.swift:28