title: How to send flash messages in Express 4.0?
body: <p>So my web application requires authentication, and I have a signup page where if the person tries to sign up with an email that is already in the database, I want to show them an error message. I'm trying to do this using this code on the html side:</p>
  
  <pre><code> &lt;% if (message.length &gt; 0) { %&gt;
     &lt;div class="alert alert-danger"&gt;&lt;%= message %&gt;&lt;/div&gt;
   &lt;% } %&gt;
  </code></pre>
  
  <p>And doing this in my routes:</p>
  
  <pre><code>router.get('/signup', function(req, res) {
    res.render('/signup', { message: req.flash('signupMessage') });
  });
  </code></pre>
  
  <p>I've tried setting up the config with something along the lines of:</p>
  
  <pre><code>app.configure(function() {
   app.use(express.session({ secret : 'keyboard cat' })); 
  });
  </code></pre>
  
  <p>But this gives me a TypeError:</p>
  
  <pre><code> 12:11:38 web.1  | app.configure(function() {
   12:11:38 web.1  |     ^
   12:11:38 web.1  | TypeError: Object function (req, res, next) {
  </code></pre>
  
  <p>I'm really confused, because I know I need sessions to be working for flash to work, but sessions don't seem to be working for me. I've also tried using only sessions and no flash, by using req.session.messages, but since I don't have sessions working this obviously did not work. </p>
  
  <p>Any insights?
  I'm using Express 4.0.0
  Thanks</p>