req.flash is never observant
In a nodejs app that uses connect flash messaging (http://extjs.github.com/Connect/flash.html), it took me a while to realize that the call
req.flash()
is never just a read-only view of what messages are in the flash object.
If you give it a message to flash, it will store it.
If you don't give it a message, it will pop off whatever messages correspond to the message type you gave it.
Look very closely at Connect's flash page and you'll understand what I mean.
Written by Miles Matthias
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#