BenjaminRH / meteor-user-session

Provides a UserSession object that works just like Session does, except it's persistent so you can preserve state across devices *and* sessions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User Session - Meteor Smart Package

Provides a UserSession object that works just like Session does, except it's persistent so you can preserve state across devices and sessions. It also provides a few extra useful methods.

API

NOTE: All of the methods defined below are also available on the server, with an additional userId argument to specify which user's session variables you want to edit.

  • UserSession.set(key, value [, server: userId]) ( anywhere ) - Set a new variable in the user session
  • UserSession.get(key [, server: userId]) ( anywhere ) - Get the value of a user session variable
  • UserSession.delete(key [, server: userId]) ( anywhere ) - Delete a user session variable, if it exists
  • UserSession.equals(key, value [, server: userId]) ( anywhere ) - Test if a user session variable is equal to a value
  • UserSession.list([server: userId]) ( anywhere ) - Get all the user session variables as an object

How to use?

  1. Install meteorite
  2. mrt add user-session

Authors

  • BenjaminRH
  • digilord

About

Provides a UserSession object that works just like Session does, except it's persistent so you can preserve state across devices *and* sessions.


Languages

Language:JavaScript 100.0%