app.use(session({
genid: function(req) {
return uuid.v4();
},
saveUninitialized: false,
resave: false,
cookie: {
name: config.get('session_cookie_name'),
maxAge: (60*60*1000*24) // Сутки
} ,
key: config.get('session_cookie_name'),
secret: config.get('session_cookie_secret'),
proxy: true,
store: MongoStore
}));