Skip to content

this is an adpatation of the logic from the connect mysql-session-store to koa-generic-session

Notifications You must be signed in to change notification settings

tb01923/koa-mysql-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
        }
}))

About

this is an adpatation of the logic from the connect mysql-session-store to koa-generic-session

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •