Problem
Souin caches responses carrying Set-Cookie without stripping it, as long as they're otherwise cacheable. The stored Set-Cookie is then replayed to every client hitting the same key — e.g. Cache-Control: public, max-age=60 + Set-Cookie: session=abc leaks one user's session to others. Set-Cookie is only dropped if the origin sends Cache-Control: no-cache="Set-Cookie".
Spec
Not a violation — RFC 9111 §7.3 says Set-Cookie "does not inhibit caching" and leaves control to the origin. But it's the well-known cookie-leak pitfall, and most CDNs/proxies strip it by default.
Proposal
Make the safe default: skip storing (or strip Set-Cookie before storing) responses that contain it, with an opt-in to keep current behavior.
@darkweak Open to this? Skip-store or strip-on-store preferred? Happy to PR.
Problem
Souin caches responses carrying
Set-Cookiewithout stripping it, as long as they're otherwise cacheable. The storedSet-Cookieis then replayed to every client hitting the same key — e.g.Cache-Control: public, max-age=60+Set-Cookie: session=abcleaks one user's session to others.Set-Cookieis only dropped if the origin sendsCache-Control: no-cache="Set-Cookie".Spec
Not a violation — RFC 9111 §7.3 says
Set-Cookie"does not inhibit caching" and leaves control to the origin. But it's the well-known cookie-leak pitfall, and most CDNs/proxies strip it by default.Proposal
Make the safe default: skip storing (or strip
Set-Cookiebefore storing) responses that contain it, with an opt-in to keep current behavior.@darkweak Open to this? Skip-store or strip-on-store preferred? Happy to PR.