init(cookieName:cookieFactory:)

Create a new SessionsConfig with the supplied cookie factory.

SessionsConfiguration.swift:20
@preconcurrency init(cookieName: String, cookieFactory: @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.

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