dflydev/fig-cookies
PSR-7 cookie helper for managing Cookie request headers and Set-Cookie response headers. Provides Cookies and SetCookies collections to read from requests/responses, modify cookie values/attributes, and render updated headers back into PSR-7 messages.
Cookie/Set-Cookie). This aligns with PSR-7 standards, improving maintainability and developer experience.SameSite, Secure, HttpOnly flags) via fluent APIs, addressing GDPR/CCPA requirements or PCI-DSS compliance for payment flows.Illuminate\Cookie) for hybrid use cases.Adopt When:
zend-expressive or slimphp/slim).SameSite policies) beyond Laravel’s built-in helpers.Set-Cookie).Look Elsewhere If:
Cookie facade (Illuminate\Cookie) suffices for most use cases.symfony/http-foundation or Laravel’s session system.For Executives: "This package standardizes cookie handling in our PHP stack, reducing technical debt and improving security compliance. By leveraging PSR-7’s immutable design, we can safely manage cookies (e.g., user preferences, tokens) without reinventing parsing logic. It’s a low-risk, high-reward upgrade—especially for APIs or high-traffic endpoints—with minimal maintenance overhead."
For Engineers: *"dflydev/fig-cookies gives us a type-safe, PSR-7-compliant way to handle cookies with less boilerplate. Key benefits:
FigRequestCookies, FigResponseCookies) simplify common tasks (e.g., get(), set(), expire()).SameSite support) align with security best practices.
Tradeoff: Slight performance cost for facade usage, but worth it for consistency. Pair with Laravel’s Cookie facade for hybrid workflows."*How can I help you explore Laravel packages today?