koa-mysql-session
a session store compatible with koa-generic-session based off of the SQL logic in the connect mysql-session-store project
Last updated 11 years ago by tb01923 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install koa-mysql-session 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.2                                ...           latest (11 years ago)

3 Versions

  • 0.0.2                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |