Class SessionStorage

Implements the Storage class for express-session using a Cache of @gibme/cache as the underlying storage provider

Hierarchy

  • Store
    • SessionStorage

Constructors

  • Constructs a new instance of the class

    Parameters

    • options: Partial<{
          checkperiod: number;
          stdTTL: number;
          storage_provider: default;
      }> = {}

    Returns SessionStorage

Methods

  • Returns all sessions from the store

    Parameters

    • callback: ((error, sessions) => void)
        • (error, sessions): void
        • Parameters

          • error: null | Error
          • sessions: SessionData[]

          Returns void

    Returns void

  • Delete all sessions from the store

    Parameters

    • callback: ((error) => void)
        • (error): void
        • Parameters

          • error: null | Error

          Returns void

    Returns void

  • Destroys the session with the given session ID

    Parameters

    • sid: string
    • callback: ((error) => void)
        • (error): void
        • Parameters

          • error: null | Error

          Returns void

    Returns void

  • Gets the session from the store given a session ID and passes it to callback.

    Parameters

    • sid: string
    • callback: ((error, session?) => void)
        • (error, session?): void
        • Parameters

          • error: null | Error
          • Optional session: null | SessionData

          Returns void

    Returns void

  • Returns the amount of sessions in the store

    Parameters

    • callback: ((error, length) => void)
        • (error, length): void
        • Parameters

          • error: null | Error
          • length: number

          Returns void

    Returns void

  • Upserts a session in the store given a session ID and SessionData

    Parameters

    • sid: string
    • session: SessionData
    • callback: ((error) => void)
        • (error): void
        • Parameters

          • error: null | Error

          Returns void

    Returns void

  • "Touches" a given session, resetting the idle timer

    Parameters

    • sid: string
    • _session: SessionData
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void