PHPackages                             lotharthesavior/chocookies - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lotharthesavior/chocookies

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lotharthesavior/chocookies
==========================

Simple package for Cookies management on Psr7 objects.

0.0.4(4y ago)042011MITPHP

Since Apr 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lotharthesavior/chocookies)[ Packagist](https://packagist.org/packages/lotharthesavior/chocookies)[ RSS](/packages/lotharthesavior-chocookies/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (5)Used By (1)

Chocookie
=========

[](#chocookie)

[![Tests](https://github.com/lotharthesavior/chocookies/actions/workflows/php.yml/badge.svg)](https://github.com/lotharthesavior/chocookies/actions/workflows/php.yml)

Package for Cookie management through [Psr7](https://www.php-fig.org/psr/psr-7/) standards.

Installation
------------

[](#installation)

Install with composer:

```
composer require lotharthesavior/chocookies
```

Usage
-----

[](#usage)

```
use Chocookies\Cookies;

Cookies::setCookie($requestOrResponse, 'my-cookie-key', 'my-cookie-data');
Cookies::getCookie($requestOrResponse, 'my-cookie-key');
```

Interface:

```
namespace Chocookies\Interfaces;

use Carbon\Carbon;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

interface CookiesInterface
{
    /**
     * Set Cookie.
     *
     * @param ResponseInterface|ServerRequestInterface $serverObject
     * @param string $cookieKey
     * @param string $cookieValue
     * @param Carbon|null $expireHour
     * @return void
     */
    public static function setCookie(
        ResponseInterface|ServerRequestInterface &$serverObject,
        string $cookieKey,
        string $cookieValue,
        ?Carbon $expireHour = null
    ): void;

    /**
     * Retrieve cookie by the key.
     *
     * @param ResponseInterface|ServerRequestInterface $serverObject
     * @param string $key
     * @return string|null
     */
    public static function getCookie(ResponseInterface|ServerRequestInterface $serverObject, string $key): ?string;

    /**
     * Expire cookie at the ResponseInterface object.
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface $response
     * @param string $key
     * @return void
     */
    public static function expireCookie(
        ServerRequestInterface $request,
        ResponseInterface &$response,
        string $key
    ): void;

    /**
     * Get an expired version of a cookie. Used to expire cookies.
     *
     * @param ServerRequestInterface $request
     * @param string $key
     * @return string
     */
    public static function getExpiredCookie(ServerRequestInterface $request, string $key): string;
}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Total

4

Last Release

1503d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1092909?v=4)[Sávio Resende](/maintainers/lotharthesavior)[@lotharthesavior](https://github.com/lotharthesavior)

---

Top Contributors

[![lotharthesavior](https://avatars.githubusercontent.com/u/1092909?v=4)](https://github.com/lotharthesavior "lotharthesavior (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lotharthesavior-chocookies/health.svg)

```
[![Health](https://phpackages.com/badges/lotharthesavior-chocookies/health.svg)](https://phpackages.com/packages/lotharthesavior-chocookies)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M36](/packages/laravel-nightwatch)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
