A Gin auth/session cookie is written with secure or httpOnly set to a literal false.
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
gin.Context.SetCookie takes them positionally: SetCookie(name, value, maxAge, path, domain, secure, httpOnly). With secure=false the cookie rides over plain HTTP where a network attacker can read it; with httpOnly=false any XSS can read it from JavaScript. For OAuth/OIDC this exposes session and token cookies to theft and hijacking (CWE-1004, CWE-614). LLM-generated Gin handlers frequently pass false, false to "make it work" over http://localhost.
Set both flags to true on auth cookies: c.SetCookie("session_id", tok, 3600, "/", "", true, true)
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.go.cookie.gin-insecure -- <reason>