Session()

Methods

bind(uid)

Bind the session with the the uid.
Parameters:
Name Type Description
uid Number User id

closed()

Closed callback for the session which would disconnect client in next tick.

get(key) → {Object}

Get value from the session.
Parameters:
Name Type Description
key String session key
Returns:
Object - value associated with session key

remove(key)

Remove value from the session.
Parameters:
Name Type Description
key String session key

send(msg)

Send message to the session.
Parameters:
Name Type Description
msg Object final message sent to client

sendBatch(msgs)

Send message to the session in batch.
Parameters:
Name Type Description
msgs Array list of message

set(key, value)

Set values (one or many) for the session.
Parameters:
Name Type Description
key String | Object session key
value Object session value

unbind(uid)

Unbind the session with the the uid.
Parameters:
Name Type Description
uid Number User id