isHTTPOnly
Does not expose the cookie over non-HTTP channels.
var isHTTPOnly: Bool
Does not expose the cookie over non-HTTP channels.
var isHTTPOnly: Bool
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct Value
A single cookie (key/value pair).
struct HTTPCookies
A collection of HTTPCookie
s.
@frozen struct Bool
A value type whose instances are either true
or false
.
init(string: String, expires: Date? = nil, maxAge: Int? = nil, domain: String? = nil, path: String? = "/", isSecure: Bool = false, isHTTPOnly: Bool = false, sameSite: SameSitePolicy? = .lax)
Creates a new HTTPCookieValue
.
init(stringLiteral value: String)
See ExpressibleByStringLiteral
.
static let expired: Value
An expired HTTPCookieValue
.
var domain: String?
The affected domain at which the cookie is active.
var expires: Date?
The cookie’s expiration date
var isSecure: Bool
Limits the cookie to secure connections.
var maxAge: Int?
The maximum cookie age in seconds.
var path: String?
The path at which the cookie is active.
var sameSite: SameSitePolicy?
A cookie which can only be sent in requests originating from the same origin as the target domain.
var string: String
The cookie’s value.
func serialize(name: String) -> String
Serializes an HTTPCookie
to a String
.