Header Session Transport

const headerTransport = require('@arangodb/foxx/sessions/transports/header');

The header transport stores session identifiers in headers on the request and response objects.

Examples

  1. const sessions = sessionsMiddleware({
  2. storage: module.context.collection('sessions'),
  3. transport: headerTransport('X-FOXXSESSID')
  4. });
  5. module.context.use(sessions);

Creating a transport

headerTransport([options]): Transport

Creates a Transport that can be used in the sessions middleware.

Arguments

  • options: Object (optional)

An object with the following properties:

  • name: string (Default: X-Session-Id)

Name of the header that contains the session identifier (not case sensitive).

If a string is passed instead of an options object, it will be interpreted as the name option.