title: Simulate ASP.NET TempData in nodejs
body: <p>How can I create object like TempData in nodejs? I thought maybe I can set flag 'IsTempData' to session and at the end of an application I would clear sessions which have this flag selected. But there is a problem: I have many asynchronous functions where I use tempdata, so application may end before I use tempdata. I hope you understand what I mean by ending application:</p>
  
  <pre><code>connect()
  .use(connect.bodyParser())
  .use(connect.query())
  .use(connect.favicon())
  .use(connect.cookieParser())
  .use(connect.session({ secret: 'your secret here' }))
  .use(function (req, res) {
      somefunction();
  
      // end of application, here I will clear sessions which have tempdata flag selected
  }).listen(1234);
  </code></pre>