ArangoDB v3.9 reached End of Life (EOL) and is no longer supported.
This documentation is outdated. Please see the most recent version at docs.arangodb.com
Session transports are used by the sessions middleware to store and retrieve
session identifiers in requests and responses. Session transports must
set methods and can optionally implement the
transport.get(request): string | null
Retrieves a session identifier from a request object.
If present this method will automatically be invoked for each transport until a transport returns a session identifier.
Request object to extract a session identifier from.
Returns the session identifier or
null if the transport can not find a
session identifier in the request.
return req.get('x-session-id') || null;
transport.set(response, sid): void
Attaches a session identifier to a response object.
If present this method will automatically be invoked at the end of a request regardless of whether the session was modified or not.
Response object to attach a session identifier to.
Session identifier to attach to the response.
Attaches a payload indicating that the session has been cleared to the response object. This can be used to clear a session cookie when the session has been destroyed (e.g. during logout).
If present this method will automatically be invoked instead of
set when the
req.session attribute was removed by the route handler.
Response object to remove the session identifier from.