Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var session = yield Session.generate({ user: 'stephen' });
var token = session.token;
session.expirationTime = Date.now();
yield session.save();
// re-fetch
var fetchedSession = yield Session.load(token);
// do something witht the newly fetched instance
assert.equals(fetchedSession.user, 'stephen');
yield fetchedSession.delete();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment