From 9f210deadf5ea3fe4a2ac3d3ed863090e3f60654 Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Mon, 30 Mar 2026 01:42:10 +0800 Subject: [PATCH] fix(cookie): add warning log when multiple SameSite values provided --- context.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/context.go b/context.go index f1d0968..2e4d2bb 100644 --- a/context.go +++ b/context.go @@ -1167,6 +1167,9 @@ func (c *Context) SetCookie(name, value string, maxAge int, path, domain string, } site := c.sameSite if len(sameSite) > 0 { + if len(sameSite) > 1 { + c.Warnf("SetCookie: only the first SameSite value will be used, got %d values", len(sameSite)) + } site = sameSite[0] } http.SetCookie(c.Writer, &http.Cookie{