Vapor Documentation Beta

Structure Memory​Sessions

public struct MemorySessions: SessionDriver

Simple in-memory sessions implementation.

%3 MemorySessions MemorySessions SessionDriver SessionDriver MemorySessions->SessionDriver

Nested Types

MemorySessions.Storage

Conforms To

SessionDriver

Capable of managing CRUD operations for Sessions.

Initializers

init(storage:​)

public init(storage: Storage)

Properties

storage

let storage: Storage

Methods

create​Session(_:​for:​)

public func createSession(_ data: SessionData, for request: Request) -> EventLoopFuture<SessionID>

read​Session(_:​for:​)

public func readSession(_ sessionID: SessionID, for request: Request) -> EventLoopFuture<SessionData?>

update​Session(_:​to:​for:​)

public func updateSession(_ sessionID: SessionID, to data: SessionData, for request: Request) -> EventLoopFuture<SessionID>

delete​Session(_:​for:​)

public func deleteSession(_ sessionID: SessionID, for request: Request) -> EventLoopFuture<Void>