Meteor - Session variables

Session variables are easy to use in meteor. the can ve get and set from the javascript code using:

Session.get('variableName');
Session.set('variableName', true);

on your HTML you can reference the get method easily by:

<template name="admin">
    {{#if $.Session.get 'variableName'}}
        I am here
    {{else}}
        I am not here
    {{/if}}
</template>
Avatar
Code dreamer, Creator of random stuff & sharing wizard

Related

comments powered by Disqus