import * as express from 'express'; import { ModuleInfo } from '../module'; import { BaseStartupTask } from './'; export declare const SESSION_COOKIE_NAME = "tendril.session.id"; export declare const POOL_KEY_SESSION = "$tendril-session-store-connection"; export declare const WARN_NO_SECRET = "[SessionStage]: Warning! No app.session.options.secret configured! A random string will be generated and used however this means user sessionswill not be valid if the application restarts!"; /** * SessionSupportTask enables http session middleware for modules that declare it. * * Enabling session support on a parent module will make it available for * all the children module as well so no need to repeat. * * This will configure session support for EACH module that declares * "app.session.enable = true". A app.session.options.secret SHOULD be provided * for signing cookies (to detect tampering). If it is not supplied the * following takes place: * * 1. The value is read from process.env.SESSION_SECRET or * 2. the value is read from process.env.COOKIE_SECRET or * 3. the value is read from process.env.SECRET otherwise * 4. a random string is generated (sessions will not survive app restarts). * * Note: If a session store is specified, this task will attempt to open its * connection and add it to the global pool. */ export declare class SessionSupportTask extends BaseStartupTask { name: string; execute(mod: ModuleInfo): Promise; } /** * handleSessionTTL is responsible for: * 1. Removing session values that have reached TTL 0. * 2. Decrementing session values that have their TTL set. * @private */ export declare const handleSessionTTL: (req: express.Request, _: express.Response, next: express.NextFunction) => void;