tulip.pkg.flash module exports the
Registering this package provides the following method and field extensions.
ok, err = Request:flash(...)
Adds flash messages to be stored for the next request. Flash messages are (short) feedback messages that are generated in one request, but only used in a subsequent request (e.g. following an account creation, after a redirect to the login page, the "account created, please login" message could be displayed). To that end, the flash messages are stored in a session cookie by the middleware registered with this package.
The following middleware are registered and can be referenced by name in the configuration.
Must be added before any handler that writes the response and any handler that uses existing flash messages. Available flash messages for a request (that is, flash messages that were added in a previous request) are stored on req.locals.flash. Messages added by Request:flash will be stored in a cookie before the response is written.