Structure
SessionData
A container for storing data associated with a given
SessionID.struct SessionData
Overview
You can add data to an instance of SessionData by subscripting:
let data = SessionData()
data["login_date"] = "\(Date())"
If you need a snapshot of the data stored in the container, such as for custom serialization to storage drivers, you can get a copy with .snapshot.
let data: SessionData = ["name": "Vapor"]
// creates a copy of the data as of this point
let snapshot = data.snapshot
client.storeUsingDictionary(snapshot)
Topics
Initializers
init()Creates a new empty session data container.init(_:)init(initialData:)
Instance Properties
snapshotA copy of the current data in the container.
Subscripts
subscript(_:)Get and set values in the container by key.
Default Implementations
Relationships
Conforms To
Swift.CopyableSwift.DecodableSwift.EncodableSwift.EquatableSwift.EscapableSwift.ExpressibleByDictionaryLiteralSwift.SendableSwift.SendableMetatype