Cookie returns the named cookie provided in the request or ErrNoCookie if not found. And return the named cookie is unescaped. If multiple cookies match the given name, only one cookie will be returned.
(name string)
| 1140 | // If multiple cookies match the given name, only one cookie will |
| 1141 | // be returned. |
| 1142 | func (c *Context) Cookie(name string) (string, error) { |
| 1143 | cookie, err := c.Request.Cookie(name) |
| 1144 | if err != nil { |
| 1145 | return "", err |
| 1146 | } |
| 1147 | val, _ := url.QueryUnescape(cookie.Value) |
| 1148 | return val, nil |
| 1149 | } |
| 1150 | |
| 1151 | // Render writes the response headers and calls render.Render to render data. |
| 1152 | func (c *Context) Render(code int, r render.Render) { |
no outgoing calls