MCPcopy Create free account
hub / github.com/kataras/iris / CookieIncluded

Function CookieIncluded

context/context.go:5574–5590  ·  view source on GitHub ↗

CookieIncluded reports whether the "cookie.Name" is in the list of "cookieNames". Notes: If "cookieNames" slice is empty then it returns true, If "cookie.Name" is empty then it returns false.

(cookie *http.Cookie, cookieNames []string)

Source from the content-addressed store, hash-verified

5572// If "cookieNames" slice is empty then it returns true,
5573// If "cookie.Name" is empty then it returns false.
5574func CookieIncluded(cookie *http.Cookie, cookieNames []string) bool {
5575 if cookie.Name == "" {
5576 return false
5577 }
5578
5579 if len(cookieNames) > 0 {
5580 for _, name := range cookieNames {
5581 if cookie.Name == name {
5582 return true
5583 }
5584 }
5585
5586 return false
5587 }
5588
5589 return true
5590}
5591
5592// var cookieNameSanitizer = strings.NewReplacer("\n", "-", "\r", "-")
5593//

Callers 3

CookieAllowReclaimFunction · 0.85
CookieAllowSubdomainsFunction · 0.85
CookieEncodingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…