PHPackages                             drewlabs/http-cookie - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. drewlabs/http-cookie

ActiveLibrary[HTTP &amp; Networking](/categories/http)

drewlabs/http-cookie
====================

HTTP cookie implementation library

v0.2.0(2y ago)0291MITPHPPHP ^7.1|^8.0

Since Aug 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/azlabsphp/http-cookies)[ Packagist](https://packagist.org/packages/drewlabs/http-cookie)[ RSS](/packages/drewlabs-http-cookie/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

cookies
=======

[](#cookies)

Provides HTTP cookie object implementation. It provides a factory class and a proxy class for creating cookie instance.

Usage
-----

[](#usage)

To create a cookie instance simply use the factory class or the factory proxy class:

```
use Drewlabs\Cookies\Factory;

$factory = new Factory;

$cookie = $factory->create('sessionid', random_int(10000, 100000) . time()); // CookieInterface

// API

$cookie->getName(); // sessionid -> Returns the cookie name

$cookie->getValue(); // -> Returns cookie value

$cookie->isHttpOnly(); // Check if the cookie is http only

$cookie->isSecure(); // Check if the cookie is secure

// etc...
```

using the factory proxy class:

```
use Drewlabs\Cookies\FactoryProxy as Factory;

$cookie = Factory::create('sessionid', random_int(10000, 100000) . time()); // CookieInterface
```

**Note** The cookie instance provide is a `Stringable` instance that easily allows developpers to convert the cookie instance into an http cookie string:

```
use Drewlabs\Cookies\FactoryProxy as Factory;

$cookie = Factory::create('sessionid', random_int(10000, 100000) . time()); // CookieInterface

printf("%s\n", (string)$cookie); // sessionid=428461690891271; Path=/; Secure; HttpOnly; SameSite=Lax
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1012d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/48c4973d500c7f4233d5ceacab51a57208d5fb60b0f95ae60264cf92380d0534?d=identicon)[azandrew-sidoine](/maintainers/azandrew-sidoine)

---

Top Contributors

[![azandrew-sidoine](https://avatars.githubusercontent.com/u/23530515?v=4)](https://github.com/azandrew-sidoine "azandrew-sidoine (2 commits)")

---

Tags

httpcookies

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drewlabs-http-cookie/health.svg)

```
[![Health](https://phpackages.com/badges/drewlabs-http-cookie/health.svg)](https://phpackages.com/packages/drewlabs-http-cookie)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.1k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[psr/http-client

Common interface for HTTP clients

1.7k680.7M2.1k](/packages/psr-http-client)[psr/link

Common interfaces for HTTP links

2.5k144.1M69](/packages/psr-link)[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M253](/packages/rmccue-requests)

PHPackages © 2026

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