Class
Session
Sessions are a method for associating data with a client accessing your app.
final class Session
Overview
Each session has a unique identifier that is used to look it up with each request to your app. This is usually done via HTTP cookies.
See Request.session() and SessionsMiddleware for more information.
Topics
Initializers
init(id: SessionID?, data: SessionData)Create a newSession.
Instance Properties
var data: SessionDataThis session’s data.var id: SessionID?This session’s unique identifier. Usually a cookie value.
Instance Methods
func authenticate<A>(A)Authenticates the model into the session.func authenticated<A>(A.Type) -> A.SessionID?Returns the authenticatable type’s ID if it exists in the session data.func destroy()Invalidates the current session, removing persisted data from the session driver and invalidating the cookie.func unauthenticate<A>(A.Type)Un-authenticates the model from the session.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype