express-session-helpers
A set of utilities to help out with express sessions.
Reference
Session Flashing
Flash a key / value pair to the session that only lives for the next request.
Usage:
const express = ;const app = ;const session = ;const flash = ; app; // This needs to be AFTER app.use(session())app; app; // app.get('/login') etc...
Then magically in your view, you have access to a flash
variable.
{% if flash.errors %} {% for error in flash %} {{ error }} {% endfor %}{% endif %}