Atomic sessions for Koa.
// create the appvar app =// attach the session to the appvar MongoDBSession = appmaxAge: '1 month'// asynchronously attach the collection// you should not start the app until you do thisMongoClient// use it in your appapp
key- cookie key
maxAge- default to 14 days
Grab the session from the database asynchronously.
Updates the new
Change properties of the session. See database-specific options below.
Updates all the properties of the
session object after running a command.
Should always be added to a
Destroys the session without creating a new one.
Creates a brand new session.
Create a CSRF token.
Assert that a CSRF token is valid.
Adds indexes on the
expires property so that expires are automatically set.
Set the collection asynchronously. You should set this collection before starting your app.
Supports most MongoDB properties. This uses mongodb-next internally. Some commands that are supported are: