Skip to content

Instantly share code, notes, and snippets.

@ozten
Created June 8, 2012 18:16
Show Gist options
  • Select an option

  • Save ozten/2897369 to your computer and use it in GitHub Desktop.

Select an option

Save ozten/2897369 to your computer and use it in GitHub Desktop.
Simple clientSessions and tobi
const
clientSessions = require('client-sessions'),
config = require('../../../lib/configuration')
express = require('express'),
sess_config = config.get('client_sessions'),
tobi = require('tobi');
var app = express.createServer();
app.use(clientSessions({
cookieName: sess_config.cookie_name,
secret: sess_config.secret,
duration: sess_config.duration
}));
app.get('/foo', function (req, res) {
res.send('ok');
});
var browser = tobi.createBrowser(app);
/* code hangs here */
browser.get('/foo', function (res, $) {
/* never runs */
console.log('finished');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment