Skip to content

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

Instance Properties

  • snapshot
    A copy of the current data in the container.

Subscripts

Default Implementations

Relationships

Conforms To

  • Swift.Copyable
  • Swift.Decodable
  • Swift.Encodable
  • Swift.Equatable
  • Swift.Escapable
  • Swift.ExpressibleByDictionaryLiteral
  • Swift.Sendable
  • Swift.SendableMetatype