Compare commits

...

3 Commits

Author SHA1 Message Date
Mohammad Reza Karimi
d4f850ecb7
Merge 5f7e9d50f589dd826ed75a08989cc4542c51fcda into 5260de6a83283abb87e827130accd495ad543cf3 2026-02-18 14:57:02 +03:30
arshamalh
5f7e9d50f5 type of returned cookies changed. 2022-06-10 04:34:04 +04:30
arshamalh
eda6ff247f Cookies added to return all cookies at once. 2022-06-10 04:17:20 +04:30

View File

@ -1147,6 +1147,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() map[string]string {
cookies := make(map[string]string)
for _, cookie := range c.Request.Cookies() {
val, _ := url.QueryUnescape(cookie.Value)
cookies[cookie.Name] = 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)