Last active
August 29, 2015 14:11
-
-
Save stephen/b18d37a675fd37dfdf14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session.generate({ user: 'stephen' }, function(err, result) { | |
var token = result.token; | |
session.set('expirationTime', Date.now()); | |
session.save(function(err, result) { | |
// re-fetch | |
Session.load(token, function(err, fetchedSession) { | |
// do something with the newly fetched instance | |
assert.equals(fetchedSession.get('user'), 'stephen'); | |
fetchedSession.delete(function(err) { | |
// done | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment