GT2/GT2-Android/node_modules/connect/lib/middleware/session.js

40 lines
785 B
JavaScript

/*!
* Connect - session
* Copyright(c) 2010 Sencha Inc.
* Copyright(c) 2011 TJ Holowaychuk
* MIT Licensed
*/
/**
* Module dependencies.
*/
var expressSession = require('express-session');
var merge = require('utils-merge');
/**
* Session:
*
* Setup session store with the given `options`.
*
* See [express-session](https://github.com/expressjs/session)
*
* @param {Object} options
* @return {Function}
* @api public
*/
module.exports = exports = function session(options) {
var opts = merge({
resave: true,
saveUninitialized: true
}, options);
return expressSession(opts);
};
exports.Cookie = expressSession.Cookie;
exports.MemoryStore = expressSession.MemoryStore;
exports.Session = expressSession.Session;
exports.Store = expressSession.Store;