The session module for PXE.js
Install @pxe/session.
# NPM
npm i @pxe/session
# Yarn
yarn add @pxe/session
SessionCreate a session instance.
session.invokectx: Context:next: NextFunction:...args: any[]:The callback of the session middleware. This can be used as a middleware:
app.use(session.invoke.bind(router));
// Or shorter
app.use(session);
Store the sessions. The default session store can cause memory leaks.
StoreCreate a new session store.
sessionStore.savedata: any: Data to be storedid: string: The idSave data and id to sessionStore matching id.
sessionStore.getid: string: The idGet the sessionStore.
sessionStore.destroyid: string: The idDestroy the sessionStore.