PHPackages                             commandstring/cookies - 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. commandstring/cookies

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

commandstring/cookies
=====================

A simpler way to manipulate cookies in PHP

v6.0.0(2y ago)1521MITPHPPHP &gt;=8.1

Since Aug 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/CommandString/Cookies)[ Packagist](https://packagist.org/packages/commandstring/cookies)[ RSS](/packages/commandstring-cookies/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)DependenciesVersions (9)Used By (0)

[CommandString/Cookies](https://packagist.org/packages/commandstring/cookies) - A simpler way to manipulate cookies in PHP
==========================================================================================================================

[](#commandstringcookies---a-simpler-way-to-manipulate-cookies-in-php)

### Install with Composer using `composer require commandstring/cookies`

[](#install-with-composer-using-composer-require-commandstringcookies)

Requirements
------------

[](#requirements)

- PHP &gt;=8.0
- Basic understanding of PHP OOP
- Composer 2

Basic Usage
-----------

[](#basic-usage)

```
require  __DIR__."/vendor/autoload.php";
use CommandString\Cookies\Cookie;

$cookies = new Cookie();

#                              v hours
#                              v valid   v seconds valid
$cookies->set("name", "value", 168, 10, 30); // by default cookies expire in a week
#                                   ^ minutes valid

// After page refresh //
echo $cookies->get("name"); // output: value

// Delete cookie //
$cookie->delete("name"); // remove the cookie

// Delete all cookies
$cookie->deleteAll();

// Check if a cookie exists
$cookie->exists("name"); // returns bool
```

Using CommandString/Encrypt with CommandString/Cookies
------------------------------------------------------

[](#using-commandstringencrypt-with-commandstringcookies)

### *[I recommend checking out the README for CommandString/Encrypt](https://github.com/CommandString/encrypt#basic-usage)*

[](#i-recommend-checking-out-the-readme-for-commandstringencrypt)

```
use CommandString\CookieEncryption\CookieEncryption;
use CommandString\Cookies\Cookie;

// use the cookieEncryption class that wraps around cmdstr/encrypt/encryption class
$cookies = new Cookie(new CookieEncryption("MZCdg02STLzrsj05KE3SIL62SSlh2Ij", "AES-256-CTR"));
// ... now cmdstr/encrypt will handle encrypting cookies
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~67 days

Recently: every ~116 days

Total

8

Last Release

896d ago

Major Versions

v1.0.1 → v2.1.22022-08-23

v2.1.2 → v3.1.12022-08-24

v3.1.2 → v4.0.02022-08-24

v4.0.0 → v5.0.12022-10-30

v5.0.1 → v6.0.02023-12-02

PHP version history (2 changes)v3.1.1PHP &gt;=8.0

v5.0.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1dc8515485fa64088fdfa03dd0f487d507dc1516824c31be2626a6ee25244dd?d=identicon)[command\_string](/maintainers/command_string)

---

Top Contributors

[![CommandString](https://avatars.githubusercontent.com/u/44886996?v=4)](https://github.com/CommandString "CommandString (17 commits)")

### Embed Badge

![Health badge](/badges/commandstring-cookies/health.svg)

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

###  Alternatives

[beechit/news-ttnewsimport

Importer of ext:tt\_news items to ext:news

2012.6k](/packages/beechit-news-ttnewsimport)

PHPackages © 2026

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