title: Passing variables on res.redirect
body: <p>Is there an easy way to pass a variable with a res.redirect in node.js / express without having to append it to the URL, or store it in a cookie, or session variable?</p>
  
  <p>Why do I want to do this? Here is an example:</p>
  
  <p>Let's say I have a users page at /users. And I can add users at the page /users/add. I post the form at /users/add, if it has errors it reloads that form with the error messages, if it goes through successfully, it redirects back to the /users page. What I want is the ability to know I just added a user and show a success message for it.</p>
  
  <p>Here is an example of a post:</p>
  
  <pre><code>exports.usersAddPost = function(req, res, next) {
    // validate form
  
    if (!validated) {
       // go back to form
       return res.render('users/add', req.body.whatever);
    } else {
       // go back to users list
       // need some way to tell users page that a user was just added
      return res.redirect('users');
    }
  };
  </code></pre>