Cookies
Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist.
Signatures
c.Cookies(key string, defaultValue ...string) string
app.Get("/", func(c *fiber.Ctx) {
// Get cookie by key:
c.Cookies("name") // "john"
c.Cookies("empty", "doe") // "doe"
})
Returned value is only valid within the handler. Do not store any references.
Make copies or use theImmutable
setting instead. Read more…