npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

koa-mysql-session

0.0.2 • Public • Published

koa-mysql-session

this is an adpatation of the logic from the connect mysql-session-store (https://github.com/sugendran/mysql-session-store) to koa-generic-session (https://github.com/koajs/generic-session).

https://www.npmjs.org/package/koa-mysql-session

Usage

npm install koa-mysql-session

example

const koa = require('koa')
    , session = require('koa-generic-session')
    , MysqlStore = require('koa-mysql-session')
    , app = koa() ;
 
const THIRTY_MINTUES = 30 * 60 * 1000;
 
const config= {
        user: "someUser",
        password: "somePwd",
        database: "someDatabase",
        host: "someHOst"
}
 
app.keys = ['your-session-secret']
app.use(session({
        store: new MysqlStore(config),
        rolling: true,
        cookie: {
            maxage:THIRTY_MINTUES
        }
}))

install

npm i koa-mysql-session

Downloadsweekly downloads

175

version

0.0.2

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability