You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partitioned cookies allow partitioning the cookie jar by top-level site, enhancing user privacy by preventing cookies from being shared across different sites. This feature is particularly useful in scenarios where a user interacts with embedded third-party services that should not have access to the main site's cookies. You can check out [CHIPS](https://developers.google.com/privacy-sandbox/3pcd/chips) for more information.
409
+
410
+
:::
411
+
412
+
```go title="Example"
413
+
app.Get("/", func(c fiber.Ctx) error {
414
+
// Create a new partitioned cookie
415
+
cookie:=new(fiber.Cookie)
416
+
cookie.Name = "user_session"
417
+
cookie.Value = "abc123"
418
+
cookie.Partitioned = true// This cookie will be stored in a separate jar when it's embeded into another website
419
+
420
+
// Set the cookie in the response
421
+
c.Cookie(cookie)
422
+
return c.SendString("Partitioned cookie set")
423
+
})
424
+
```
425
+
405
426
## Cookies
406
427
407
428
Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist.
Copy file name to clipboardExpand all lines: docs/whats_new.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,9 @@ To enable the routing changes above we had to slightly adjust the signature of t
186
186
DRAFT section
187
187
:::
188
188
189
+
### New Features
190
+
191
+
- Cookie now allows Partitioned cookies for [CHIPS](https://developers.google.com/privacy-sandbox/3pcd/chips) support. CHIPS (Cookies Having Independent Partitioned State) is a feature that improves privacy by allowing cookies to be partitioned by top-level site, mitigating cross-site tracking.
0 commit comments