diff --git a/context.go b/context.go index 46bf1133..ef8649ca 100644 --- a/context.go +++ b/context.go @@ -897,6 +897,16 @@ func (c *Context) Cookie(name string) (string, error) { return val, nil } +// Cookies parses and returns the HTTP cookies sent with the request. +func (c *Context) Cookies() []string { + var cookies []string + for _, cookie := range c.Request.Cookies() { + val, _ := url.QueryUnescape(cookie.Value) + cookies = append(cookies, val) + } + return cookies +} + // Render writes the response headers and calls render.Render to render data. func (c *Context) Render(code int, r render.Render) { c.Status(code)