-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
Bug Description
It appears that despite issuing messages := c.Redirect().Messages(), the flash messages are never cleared and hence keep re-appearing on every page reload and even on other pages that also check for flash messages.
CC: #3455 (comment)
How to Reproduce
Steps to reproduce the behavior:
- Set flash messages:
func (req *Request) redirect(url string) (err error) {
redir := req.c.Redirect()
for key, msg := range AllMyFlashMessages() {
redir = redir.With(key, msg)
}
return redir.To(url)
}- Request the flash messages inside a handler and display them on the page
- Trigger flash messages to be set
- Load any page displaying the flash messages
Expected Behavior
After issuing messages := c.Redirect().Messages() the flash messages should be gone. You can validate that this is not the case simply by issuing that line of code two times, one after the other. Both will return messages.
Fiber Version
v3
Code Snippet (optional)
Checklist:
- I agree to follow Fiber's Code of Conduct.
- I have checked for existing issues that describe my problem prior to opening this one.
- I understand that improperly formatted bug reports may be closed without explanation.
Metadata
Metadata
Assignees
Type
Projects
Status
No status