Flash Messages
Last updated
Was this helpful?
Last updated
Was this helpful?
Sometimes you need to temporarily store data between requests of the same user, such as error or success messages after a form submission. The Iris sessions package supports flash messages.
As we've seen the chapter, you initialize a session like this:
The Session
contains the following methods to store, retrieve and remove flash messages.
The method names are self-explained. For example, if you need to get a message and remove it at the next request use the GetFlash
. When you only need to retrieve but don't remove then use the PeekFlash
.
Flash messages are not stored in a database.