feat: Add support for sameSite field (#628)

Recent browsers (and HTTP) added "sameSite" setting to limit cross site attacks.
Add support for exporting this property from Firefox and Chrome and to export to csv and cookie-editor format.
Also extract new "session" and "hostOnly" properties for cookie-editor format.
Tested on Firefox, Chrome and Chromium.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
freddy77
2026-08-07 10:14:40 +08:00
committed by GitHub
parent df20f73b7a
commit 18d841f68f
6 changed files with 52 additions and 9 deletions
+2 -2
View File
@@ -106,14 +106,14 @@ func TestWrite_CSV_Cookie(t *testing.T) {
assert.Equal(t,
[]string{
"browser", "profile", "host", "path", "name", "value",
"is_secure", "is_http_only", "has_expire", "is_persistent", "expire_at", "created_at",
"is_secure", "is_http_only", "has_expire", "is_persistent", "expire_at", "created_at", "same_site",
},
records[0],
)
assert.Equal(t,
[]string{
"Chrome", "Default", ".example.com", "/", "session", "abc123",
"true", "true", "true", "true", "2026-01-15T10:30:00Z", "2026-01-15T10:30:00Z",
"true", "true", "true", "true", "2026-01-15T10:30:00Z", "2026-01-15T10:30:00Z", "",
},
records[1],
)