express-session-sqlite
A session store for express-session
using SQLite.
Fully unit tested. PRs welcomed.
Install
$ npm i express-session-sqlite sqlite3 --save
Usage
import * as sqlite3 from 'sqlite3'
import * as express from 'express'
import * as session from 'express-session'
import sqliteStoreFactory from 'express-session-sqlite'
const SqliteStore = sqliteStoreFactory(session)
const app = express()
app.use(session({
store: new SqliteStore({
driver: sqlite3.Database,
path: '/tmp/sqlite.db',
ttl: 1234,
prefix: 'sess:',
cleanupInterval: 300000
}),
}))
Debugging
This module uses debug
under the name express-session-sqlite
. When starting up your app, do the following:
$ DEBUG=express-session-sqlite node app.js