Created
December 9, 2014 23:09
-
-
Save stephen/f6538573bd3fc5d12492 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
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