MCPcopy Create free account
hub / github.com/BryanMwangi/pine / parseCookies

Function parseCookies

pine.go:514–524  ·  view source on GitHub ↗
(cookieHeader string)

Source from the content-addressed store, hash-verified

512}
513
514func parseCookies(cookieHeader string) map[string]Cookie {
515 cookies := make(map[string]Cookie)
516 pairs := strings.Split(cookieHeader, "; ")
517 for _, pair := range pairs {
518 if strings.Contains(pair, "=") {
519 parts := strings.SplitN(pair, "=", 2)
520 cookies[parts[0]] = Cookie{Name: parts[0], Value: parts[1]}
521 }
522 }
523 return cookies
524}
525
526// DeleteCookie expires the named cookies by setting Max-Age=-1.
527func (c *Ctx) DeleteCookie(names ...string) *Ctx {

Callers 1

ReadCookieMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected