Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionStore

A session store is used to store sessions for an Vert.x-Web web app

Hierarchy

Index

Properties

Static Readonly DEFAULT_SESSIONID_LENGTH

DEFAULT_SESSIONID_LENGTH: number

Default length for a session id. More info: https://www.owasp.org/index.php/Session_Management_Cheat_Sheet

Methods

clear

  • clear(): PromiseLike<void>
  • clear(resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): SessionStore
  • Remove all sessions from the store.

    Returns PromiseLike<void>

  • Remove all sessions from the store.

    Parameters

    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns SessionStore

close

  • close(): void
  • Close the store

    Returns void

createSession

  • createSession(timeout: number): Session
  • createSession(timeout: number, length: number): Session
  • Create a new session using the default min length.

    Parameters

    • timeout: number

    Returns Session

  • Create a new session.

    Parameters

    • timeout: number
    • length: number

    Returns Session

delete

  • delete(id: string): PromiseLike<void>
  • delete(id: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): SessionStore
  • Delete the session with the specified ID.

    Parameters

    • id: string

    Returns PromiseLike<void>

  • Delete the session with the specified ID.

    Parameters

    • id: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns SessionStore

get

  • get(cookieValue: string): PromiseLike<Session>
  • get(cookieValue: string, resultHandler: ((res: AsyncResult<Session>) => void) | Handler<AsyncResult<Session>>): SessionStore
  • Get the session with the specified ID.

    Parameters

    • cookieValue: string

    Returns PromiseLike<Session>

  • Get the session with the specified ID.

    Parameters

    • cookieValue: string
    • resultHandler: ((res: AsyncResult<Session>) => void) | Handler<AsyncResult<Session>>

    Returns SessionStore

init

  • Initialize this store.

    Parameters

    • vertx: Vertx
    • options: {}
      • [key: string]: any

    Returns SessionStore

put

  • put(session: Session): PromiseLike<void>
  • put(session: Session, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): SessionStore
  • Add a session with the specified ID.

    Parameters

    Returns PromiseLike<void>

  • Add a session with the specified ID.

    Parameters

    • session: Session
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns SessionStore

retryTimeout

  • retryTimeout(): number
  • The retry timeout value in milli seconds used by the session handler when it retrieves a value from the store.

    A non positive value means there is no retry at all.

    Returns number

size

  • size(): PromiseLike<number>
  • size(resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): SessionStore
  • Get the number of sessions in the store.

    Beware of the result which is just an estimate, in particular with distributed session stores.

    Returns PromiseLike<number>

  • Get the number of sessions in the store.

    Beware of the result which is just an estimate, in particular with distributed session stores.

    Parameters

    • resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>

    Returns SessionStore

Static create

  • Create a Session store given a backend and configuration JSON.

    Parameters

    • vertx: Vertx

    Returns SessionStore

  • Create a Session store given a backend and configuration JSON.

    Parameters

    • vertx: Vertx
    • options: {}
      • [key: string]: any

    Returns SessionStore

Generated using TypeDoc