Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 667 Bytes

README.md

File metadata and controls

19 lines (12 loc) · 667 Bytes

#connect-mysql

This is a very, very simple MySQL backed session store for connect.

It uses an already established node-mysql client for the connection, and creates a 'sessions' table if it doesn't exist.

To use:

var express = require('express'),
    mysql = require('mysql').createClient({ user: 'dbuser', password: 'dbpassword', database: 'db' }),
    MySQLStore = require('connect-mysql')(express);

var app = express.createServer();
app.use(express.cookieParser());
app.use(express.session({ secret: 'supersecretkeygoeshere', store: new MySQLStore({ client: mysql })));

License: MIT