Version: v0.5.1 - Beta.  We welcome contributors & feedback.  THanks!


Session.set(key, value)


Set a one-time session value for the given key.

This value will only persist in the session until the following request.

Flash values are often used for success and error messages after the user submits an action.

// ... process user action ...

Session.setFlash('message', 'Congratulations!');

// ... in the NEXT request only ...

// In HTML template
:: if (Session.hasFlash('message')) {
    <div>{{ Session.getFlash('message') }}</div>
:: }

//= <div>Congratulations!</div>