Compare commits

...

3 Commits

Author SHA1 Message Date
Mohammad Reza Karimi
afd2f48196
Merge 5f7e9d50f589dd826ed75a08989cc4542c51fcda into 915e4c90d28ec4cffc6eb146e208ab5a65eac772 2025-12-27 14:56:14 +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

@ -1122,6 +1122,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)