A cookie is set to SameSite = SameSiteMode.None, which removes the SameSite defense and sends the cookie on cross-site requests.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
For an authentication or session cookie this re-opens the CSRF surface that Lax/Strict closes, and None is only safe when the cookie is also marked Secure (browsers reject SameSite=None without it) (CWE-1275). This is a common AI-generated change made to get a cookie flowing in an embedded/cross-site scenario.
Leave auth/session cookies at SameSiteMode.Lax (the framework default) or SameSiteMode.Strict. Only use SameSiteMode.None for a genuinely cross-site cookie, and when you do, also set Secure = true and rely on anti-forgery tokens for CSRF protection.
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.csharp.cookie.samesite-none -- <reason>