Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Initializer

init(cookieName:cookieFactory:)

Create a new SessionsConfig with the supplied cookie factory.
init(cookieName: String, cookieFactory: @Sendable @escaping (SessionID) -> HTTPCookies.Value)

Parameters

cookieName

Name of HTTP cookie, used as a key for the cookie value.

cookieFactory

Creates a new HTTPCookieValue for the supplied value String.

Discussion

let sessionsConfig = SessionsConfig(cookieName: "vapor-session") { value in
    return HTTPCookieValue(string: value, isSecure: true)
}