sessions

10gen supports database-backed sessions. They are created automatically for you in your application scope, and use cookies to associate users with session data. If you do not use sessions in your code, no cookie will be set, nor will anything be stored in the database.

The session object is in your scope under the session key, and you can use it like any other collection. For example, if you wanted to save a property called foo, you would write :

session.foo = 6;

and then to retrieve information from the session :

var myFoo = sesssion.foo;

Once you modify a session, the cookie will automatically be set, and the object will be save to the DB if modified.

Sessions timeout. this is not implemented yet - so now they don't timeout