Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface UserSessionOptions

Hierarchy

  • UserSessionOptions

Properties

Readonly cache-control

cache-control: boolean

Whether to set Cache-Control: no-cache="Set-Cookie, Set-Cookie2" response header for the requests that deliver access and refresh tokens to client (i.e. CookieUserSessionMiddleware.create and CookieUserSessionMiddleware.renew operations).

Readonly cookie

Session id cookie options.

Readonly csrf

csrf: object

CSRF header options applied only when requests are made from browser devices.
After session creation, all subsequent requests will need to include {@link UserSessionOptions.csrf.name} header with value {@link UserSessionOptions.csrf.value}.
This is needed for CSRF mitigation.

Type declaration

  • Readonly name: string

    Lowercase name of the CSRF header.

    example


    x-requested-with

  • Readonly value: HttpHeaderValue

    Value of the the CSRF header.
    This value will be used for comparison with the one from HTTP request. In case they not match, an error is thrown and request will be aborted.

    example


    XmlHttpRequest

Readonly header

header: string

Lowercase name of header in the HTTP response which will contain session id.
This option is related to non-browser devices, which will receive session id via header, instead of cookies.
Decision whether is a browser on non-browser device is taked based on device property from the HTTP request object.

Notice that on further subsequent requests, session id will need to be included in the Authorization header.

example


x-session-id