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
secure=False lets the cookie travel over plain HTTP (it can be sniffed on the wire), and httponly=False exposes it to JavaScript so an XSS payload can read and exfiltrate it. Either way the session token is at risk of theft (CWE-614, OWASP A05:2021). The same applies to Django's SESSION_COOKIE_SECURE = False, CSRF_COOKIE_SECURE = False, and SESSION_COOKIE_HTTPONLY = False settings.
Always set Secure + HttpOnly (and ideally SameSite) on auth cookies, e.g. response.set_cookie("session", token, secure=True, httponly=True, samesite="Lax") or, in Django settings, SESSION_COOKIE_SECURE = True and SESSION_COOKIE_HTTPONLY = True.
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.