Sessions

public protocol Sessions

Capable of managing CRUD operations for Sessions.

  • Stores a newly created Session.

    Declaration

    Swift

    func createSession(_ session: Session) throws -> Future<Void>

    Parameters

    session

    New Session to create.

    Return Value

    A Future that will be completed when the operation has finished.

  • Fetches a session for the supplied cookie value.

    Declaration

    Swift

    func readSession(sessionID: String) throws -> Future<Session?>

    Parameters

    sessionID

    String identifier of the Session to fetch.

    Return Value

    Session if found, nil if none exists.

  • Updates the session. Call before the response with the session cookie is returned.

    Declaration

    Swift

    func updateSession(_ session: Session) throws -> Future<Void>

    Parameters

    session

    Existing Session to update.

    Return Value

    A Future that will be completed when the operation has finished.

  • Destroys the session. Call if the response is no longer valid.

    Declaration

    Swift

    func destroySession(sessionID: String) throws -> Future<Void>

    Parameters

    sessionID

    String identifier of the Session to destroy.

    Return Value

    A Future that will be completed when the operation has finished.