MCPcopy
hub / github.com/gofiber/fiber / parseAndClearFlashMessages

Method parseAndClearFlashMessages

redirect.go:407–425  ·  view source on GitHub ↗

parseAndClearFlashMessages is a method to get flash messages before they are getting removed

()

Source from the content-addressed store, hash-verified

405
406// parseAndClearFlashMessages is a method to get flash messages before they are getting removed
407func (r *Redirect) parseAndClearFlashMessages() {
408 // parse flash messages
409 cookieValue, err := hex.DecodeString(r.c.Cookies(FlashCookieName))
410 if err != nil {
411 return
412 }
413
414 _, err = r.c.flashMessages.UnmarshalMsg(cookieValue)
415 if err != nil {
416 return
417 }
418
419 r.c.Cookie(&Cookie{
420 Name: FlashCookieName,
421 Value: "",
422 Path: "/",
423 MaxAge: -1,
424 })
425}
426
427// processFlashMessages is a helper function to process flash messages and old input data
428// and set them as cookies

Calls 3

CookiesMethod · 0.65
CookieMethod · 0.65
UnmarshalMsgMethod · 0.45