SessionData
A container for storing data associated with a given SessionID
.
struct SessionData
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)