BenAffee,
var express = require('express');
var app = module.exports = express();
//----------подключаем базу данных и сессии
var mysql = require('mysql');
var session = require('express-session');
var MySQLStore = require('express-mysql-session')(session);
var optionsDB = {
host: 'localhost',
port: 3306,
user: 'user',
password: 'pass',
database: 'f724'
};
var connection = mysql.createConnection(optionsDB);
var sessionStore = new MySQLStore({}, connection);
connection.connect();
app.use(session({
key: 'session_cookie_name',
secret: 'session_cookie_secret',
store: sessionStore,
resave: false,
saveUninitialized: false
}))