title: Is it a bad idea to set current user as session variable in meteor / react framework?
body: <p>I am using meteor + react to develop a small app, mostly to understand the workings of react. I am currently not using any form of Flux or Redux.</p>
  
  <p>During multiple instance in the app I have to check if the person using the app is logged in. I am currently doing this with a dataContainer from react-meteor-data. </p>
  
  <pre><code>import { createContainer } from 'meteor/react-meteor-data';
  ...
  class NavigationBar extends Component {
      render () {
          return (
              &lt;div&gt;
                  this.props.currentUser
              &lt;/div&gt;
          )
      }
  }
  ... 
  export default createContainer(() =&gt; {
      let currentUser = Meteor.user()
      return {
          currentUser,
      };
  }, NavigationBar);
  </code></pre>
  
  <p>While this works fine, I am starting to find it a bit annoying to have to wrap every component in which I want to check the current user. Since I have customized login and logout functions anyway I was wondering if there is anything wrong (insecure) about setting the current user in a session variable on loggin like this: </p>
  
  <pre><code>&gt; Session.set('currentUser',Meteor.userId());
  </code></pre>
  
  <p>and then just setting it to null on logout?</p>
  
  <p>Thx alot</p>