An in-memory representation of a client or user connection that can be saved to disk. Data will be passed around via a Context to resources.
A store for persisting sessions in-between connection and disconnection. Automatically creates session IDs on inserted objects.
var session = new Session({id: 'my-sid', new SessionStore('sessions', db)});
session.set({uid: 'my-uid'}).save();
data
{Object} The data used to construct the session.
store
{SessionStore} The store used to persist the session.
sockets
{Socket.IO.sockets} The Socket.IO sockets object used to attach an existing socket.
fn(err, data)
{Function} optionalSave the in memory representation of a session to its store.
fn(err, data)
{Function} optionalReset the session using the data persisted in its store.
event
{String}The event to emit to all session's sockets.
data
{Object} optionalThe data to send to sockets listening to the given event.
collection
{Collection}The user-collection instance (eg. dpd.todos) to use to find users.
query
{Object}Only emit the event to users that match this query.
event
{String}The event to emit to all session's sockets.
data
{Object} optionalThe data to send to sockets listening to the given event.
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!