PackageTrack
Sign in Get early access

dflydev/fig-cookies

Cookies for PSR-7 HTTP Message Interface.

v3.2.0 9.3M downloads/mo #1955 most downloaded on Packagist dflydev/dflydev-fig-cookies

What this package is like to depend on

Last release 11 months ago

03 Sep 2025

Ships fairly regularly

a new release about every 1.5 years

Most releases are documented

notes for 6 of 10 stable releases

Nothing withdrawn

no release was ever pulled

11 years old

10 releases · first in 2015

1 release in the last 12 months

see the full history below

Release timeline

10 releases · Jun 2015 to Sep 2025
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 10
  1. v3.2.0 03 Sep 2025
    Release notes

    What's Changed

    • Updates CI to run on PHP 8.3 through 8.5-dev by @gsteel in #63
    • Adds support for CHIPS partitioned cookies by @battis in #62
      Partitioned cookies can be created by calling withPartitioned on the cookie instance, for example:
      SetCookie::create('someCookie')->withPartitioned();
      For further information, see MDN Docs

    New Contributors

    Full Changelog: v3.1.0...v3.2.0

    Open source →
  2. v3.1.0 18 Jul 2023
    Release notes

    What's Changed

    • CI Fixes by @franzliedke in #46
    • Deprecate cookie expiry facades

      The methods FigResponseCookies::expire() and SetCookie::createExpired() have been deprecated. In order to expire a cookie, create a SetCookie instance with properties that match the existing cookie and call expire, passing the new SetCookie instance to FigResponseCookies::set().
      by @franzliedke in #45
    • Documentation Fix

      Fix minor grammatical error in the README by @settermjd in #49
    • Allow psr/http-message ^2

      Expands composer constraint for psr/http-message to ^1 || ^2
      by @gsteel in #60

    New Contributors

    Full Changelog: v3.0.0...v3.1.0

    Open source →
  3. v3.0.0 22 Jan 2021
    Release notes

    Updated to support PHP 8.

    Open source →
  4. v2.0.3 07 Dec 2020
    Release notes

    Fix potential issue with malformed cookies causing catastrophic errors instead of simply returning a cookie with no value. #42

    Open source →
  5. v2.0.2 04 Dec 2020
    Release notes

    Merge pull request #40 from weierophinney/security/do-not-decode-cook…

    …ie-names

    Do not decode cookie names, just values

    Open source →
  6. v2.0.1 02 Jan 2020

    Nothing published for this version

  7. v2.0.0 11 Jul 2018
    Release notes

    Added

    • #32 all public API of the
      project now has extensive parameter and return type declarations.
      If you are using the library with declare(strict_types=1); in your codebase, you
      will need to run static analysis against your code to find possible type incompatibilities
      in method calls.
      If you are inheriting any of your code from this library, you will need to check
      that your type signatures respect variance and covariance with the symbols you are
      inheriting from. Here is a full list of the changes:

      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookie#__construct() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\Cookie#__construct() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookie#__construct() changed from no type to string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\Cookie#__construct() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie#getName() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie#getValue() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie#withValue() changed from no type to Dflydev\FigCookies\Cookie
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\Cookie#withValue() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\Cookie#withValue() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie#__toString() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie::create() changed from no type to Dflydev\FigCookies\Cookie
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookie::create() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\Cookie::create() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookie::create() changed from no type to string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\Cookie::create() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie::listFromCookieString() changed from no type to array
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\Cookie::listFromCookieString() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\Cookie::listFromCookieString() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookie::oneFromCookiePair() changed from no type to Dflydev\FigCookies\Cookie
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\Cookie::oneFromCookiePair() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\Cookie::oneFromCookiePair() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigRequestCookies::get() changed from no type to Dflydev\FigCookies\Cookie
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigRequestCookies::get() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\FigRequestCookies::get() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigRequestCookies::get() changed from no type to string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\FigRequestCookies::get() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigRequestCookies::set() changed from no type to Psr\Http\Message\RequestInterface
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigRequestCookies::modify() changed from no type to Psr\Http\Message\RequestInterface
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigRequestCookies::modify() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $modify of Dflydev\FigCookies\FigRequestCookies::modify() changed from no type to a non-contravariant callable
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigRequestCookies::modify() changed from no type to string
      [BC] CHANGED: The parameter $modify of Dflydev\FigCookies\FigRequestCookies::modify() changed from no type to callable
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigRequestCookies::remove() changed from no type to Psr\Http\Message\RequestInterface
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigRequestCookies::remove() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigRequestCookies::remove() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies#has() changed from no type to bool
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookies#has() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookies#has() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies#get() changed from no type to ?Dflydev\FigCookies\SetCookie
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookies#get() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookies#get() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies#getAll() changed from no type to array
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies#with() changed from no type to Dflydev\FigCookies\SetCookies
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies#without() changed from no type to Dflydev\FigCookies\SetCookies
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookies#without() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookies#without() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies#renderIntoSetCookieHeader() changed from no type to Psr\Http\Message\ResponseInterface
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies::fromSetCookieStrings() changed from no type to self
      [BC] CHANGED: The parameter $setCookieStrings of Dflydev\FigCookies\SetCookies::fromSetCookieStrings() changed from no type to a non-contravariant array
      [BC] CHANGED: The parameter $setCookieStrings of Dflydev\FigCookies\SetCookies::fromSetCookieStrings() changed from no type to array
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookies::fromResponse() changed from no type to Dflydev\FigCookies\SetCookies
      [BC] CHANGED: The return type of Dflydev\FigCookies\StringUtil::splitOnAttributeDelimiter() changed from no type to array
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\StringUtil::splitOnAttributeDelimiter() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\StringUtil::splitOnAttributeDelimiter() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\StringUtil::splitCookiePair() changed from no type to array
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\StringUtil::splitCookiePair() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\StringUtil::splitCookiePair() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getName() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getValue() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getExpires() changed from no type to int
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getMaxAge() changed from no type to int
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getPath() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getDomain() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getSecure() changed from no type to bool
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#getHttpOnly() changed from no type to bool
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withValue() changed from no type to self
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\SetCookie#withValue() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\SetCookie#withValue() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withExpires() changed from no type to self
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#rememberForever() changed from no type to self
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#expire() changed from no type to self
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withMaxAge() changed from no type to self
      [BC] CHANGED: The parameter $maxAge of Dflydev\FigCookies\SetCookie#withMaxAge() changed from no type to a non-contravariant ?int
      [BC] CHANGED: The parameter $maxAge of Dflydev\FigCookies\SetCookie#withMaxAge() changed from no type to ?int
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withPath() changed from no type to self
      [BC] CHANGED: The parameter $path of Dflydev\FigCookies\SetCookie#withPath() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $path of Dflydev\FigCookies\SetCookie#withPath() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withDomain() changed from no type to self
      [BC] CHANGED: The parameter $domain of Dflydev\FigCookies\SetCookie#withDomain() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $domain of Dflydev\FigCookies\SetCookie#withDomain() changed from no type to ?string
      [BC] CHANGED: Default parameter value for for parameter $secure of Dflydev\FigCookies\SetCookie#withSecure() changed from NULL to true
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withSecure() changed from no type to self
      [BC] CHANGED: The parameter $secure of Dflydev\FigCookies\SetCookie#withSecure() changed from no type to a non-contravariant bool
      [BC] CHANGED: The parameter $secure of Dflydev\FigCookies\SetCookie#withSecure() changed from no type to bool
      [BC] CHANGED: Default parameter value for for parameter $httpOnly of Dflydev\FigCookies\SetCookie#withHttpOnly() changed from NULL to true
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#withHttpOnly() changed from no type to self
      [BC] CHANGED: The parameter $httpOnly of Dflydev\FigCookies\SetCookie#withHttpOnly() changed from no type to a non-contravariant bool
      [BC] CHANGED: The parameter $httpOnly of Dflydev\FigCookies\SetCookie#withHttpOnly() changed from no type to bool
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie#__toString() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie::create() changed from no type to self
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookie::create() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\SetCookie::create() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookie::create() changed from no type to string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\SetCookie::create() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie::createRememberedForever() changed from no type to self
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookie::createRememberedForever() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\SetCookie::createRememberedForever() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookie::createRememberedForever() changed from no type to string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\SetCookie::createRememberedForever() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie::createExpired() changed from no type to self
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookie::createExpired() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\SetCookie::createExpired() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\SetCookie::fromSetCookieString() changed from no type to self
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\SetCookie::fromSetCookieString() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\SetCookie::fromSetCookieString() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigResponseCookies::get() changed from no type to Dflydev\FigCookies\SetCookie
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigResponseCookies::get() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\FigResponseCookies::get() changed from no type to a non-contravariant ?string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigResponseCookies::get() changed from no type to string
      [BC] CHANGED: The parameter $value of Dflydev\FigCookies\FigResponseCookies::get() changed from no type to ?string
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigResponseCookies::set() changed from no type to Psr\Http\Message\ResponseInterface
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigResponseCookies::expire() changed from no type to Psr\Http\Message\ResponseInterface
      [BC] CHANGED: The parameter $cookieName of Dflydev\FigCookies\FigResponseCookies::expire() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $cookieName of Dflydev\FigCookies\FigResponseCookies::expire() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigResponseCookies::modify() changed from no type to Psr\Http\Message\ResponseInterface
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigResponseCookies::modify() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $modify of Dflydev\FigCookies\FigResponseCookies::modify() changed from no type to a non-contravariant callable
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigResponseCookies::modify() changed from no type to string
      [BC] CHANGED: The parameter $modify of Dflydev\FigCookies\FigResponseCookies::modify() changed from no type to callable
      [BC] CHANGED: The return type of Dflydev\FigCookies\FigResponseCookies::remove() changed from no type to Psr\Http\Message\ResponseInterface
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigResponseCookies::remove() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\FigResponseCookies::remove() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies#has() changed from no type to bool
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookies#has() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookies#has() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies#get() changed from no type to ?Dflydev\FigCookies\Cookie
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookies#get() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookies#get() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies#getAll() changed from no type to array
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies#with() changed from no type to Dflydev\FigCookies\Cookies
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies#without() changed from no type to Dflydev\FigCookies\Cookies
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookies#without() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $name of Dflydev\FigCookies\Cookies#without() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies#renderIntoCookieHeader() changed from no type to Psr\Http\Message\RequestInterface
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies::fromCookieString() changed from no type to self
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\Cookies::fromCookieString() changed from no type to a non-contravariant string
      [BC] CHANGED: The parameter $string of Dflydev\FigCookies\Cookies::fromCookieString() changed from no type to string
      [BC] CHANGED: The return type of Dflydev\FigCookies\Cookies::fromRequest() changed from no type to Dflydev\FigCookies\Cookies
      
    • #31 A new abstraction was
      introduced to support SameSite=Lax and SameSite=Strict Set-Cookie header modifiers.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #31 SetCookie#withExpires()
      will now reject any expiry time that cannot be parsed into a timestamp.
    • #31 A SetCookie can no longer
      be constructed via Dflydev\FigCookies\SetCookie::fromSetCookieString(''): an empty string
      will now be rejected.
    Open source →
  8. v1.0.2 28 Mar 2016

    Nothing published for this version

  9. v1.0.1 03 Jun 2015

    Nothing published for this version

  10. v1.0.0 03 Jun 2015

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive