title: How do I write a conditional for express-sessions login/logout in my main handlebars layout?
body: <p>I have my login/logout routes written in my controllers.</p>
  
  <pre><code>//LOGIN FORM
  app.get('/login', function (req, res) {
      res.render('../views/signup-signin/login');
  });
  
  //LOGIN POST
  app.post('/login', function (req, res) {
      User.find(req.body.username, function (user) {
          bcrypt.compare(req.body.password, user.password, function (err, result) {
              if (result) {
                  req.session.currentUser = user.id;
                  res.redirect('/');
              } else {
                  res.redirect('/login');
              }
          });
      });
  });
  
  //LOGOUT
  app.delete('/logout', function (req, res) {
      req.session.currentUser = null;
      res.redirect('/');
  });
  </code></pre>
  
  <p>What I'm having trouble with is being able to write an if/else statement in my 'main.handlebars' layout that renders Sign Up/Login when req.session.currentUser = null, and Logout when req.session.currentUser = user.id</p>
  
  <pre><code>&lt;div id="signin_up"&gt;
          &lt;a href="/signup"&gt;&lt;button&gt;Sign Up&lt;/button&gt;&lt;/a&gt;
          &lt;a href="/login"&gt;&lt;button&gt;Login&lt;/button&gt;&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;form action="/logout" method="POST"&gt;
      &lt;input type="hidden" name="_method" value="DELETE"&gt;
      &lt;input type="submit" value="Logout"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I can't figure out how to get access to the sessions id and write this in a script tag in the 'main.handlebars' file.</p>
  
  <p>Can anyone help me get this feature working?</p>
  
  <p>Thanks ahead of time!</p>