Sessions are persisted in a modified store. This store has several methods to help create and manage sessions.
A store for persisting sessions in-between connection and disconnection. Automatically creates session IDs on inserted objects.
var db = process.server.db;
var sockets = process.server.sockets;
var name = 'sessions';
var store = new SessionStore(name, db, sockets);
name
{String} The name of the db store.
db
{Db} The server db instance
sockets
{Socket.IO.sockets} The socket.io sockets
object.
sid
{String} optionalAn existing session id.
fn(err, session)
{Function}Called once the session has been created.
Let us know if you have any ideas to improve our docs. Open an issue on github, send us an email, or tweet us.
This entire site, including documentation written in markdown is available on github. Pull requests are appreciated!