How to use the koa-generic-session.MemoryStore function in koa-generic-session

To help you get started, we’ve selected a few koa-generic-session examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / koa-generic-session / koa-generic-session-tests.ts View on Github external
import * as Koa from "koa";
import {MemoryStore, Session} from "koa-generic-session";
import session = require("koa-generic-session");

const app = new Koa();

app.use(session({
    key: 'sessionKey',
    store: MemoryStore(),
    ttl: 60 * 60,
    prefix: 'a-prefix',
    cookie: {
        path: '/test',
        rewrite: false,
        signed: false,
        maxAge: 60 * 60,
        secure: true,
        httpOnly: true,
    },
    allowEmpty: false,
    defer: false,
    reconnectTimeout: 100,
    rolling: false,
    sessionIdStore: {
        get: () => 'something',

koa-generic-session

koa generic session store by memory, redis or others

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Popular koa-generic-session functions