PHPackages                             coercive/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. [Security](/categories/security)
4. /
5. coercive/cookie

ActiveLibrary[Security](/categories/security)

coercive/cookie
===============

Coercive Security Cookie

1.1.4(5y ago)01.6k1MITPHP &gt;=7

Since Jul 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Coercive/Cookie)[ Packagist](https://packagist.org/packages/coercive/cookie)[ Docs](http://coercive.fr)[ RSS](/packages/coercive-cookie/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (8)Used By (1)

Coercive Security Cookie
========================

[](#coercive-security-cookie)

Cookie allows you to create / read / delete normal or encrypted cookies.

Get
---

[](#get)

```
composer require coercive/cookie

```

Usage
-----

[](#usage)

```
use Coercive\Security\Cookie\Cookie;

# No need to reload the document.
# The Cookie class creates and deletes cookies also in the super global $_COOKIE.

# Instantiate and set your options
$cookie = new Cookie;
$cookie->setPath('/');
$cookie->setDomain('.domain.extension');
// etc...

# Option : anonymise -> cookie names are now sha1 + salt
$cookie->anonymize(true, 'abcd1234');
# You can prefix anonymised cookie : Hello_*************
$cookie->anonymize(true, 'abcd1234', 'Hello_');

# Plain cookie
$cookie->set('MyCookie', 'Hey ! This is an example cookie !', time() + 600);
$var = $cookie->get('MyCookie');

# Crypted cookie
$cookie = new Cookie('My Password');
$cookie->setSafe('MyCookie', 'Hey ! This is an example cookie !', time() + 600);
$var = $cookie->getSafe('MyCookie');

# Delete cookie
$cookie->delete('MyCookie');
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

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

Recently: every ~292 days

Total

7

Last Release

1844d ago

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

1.1.0PHP &gt;=7.1

1.1.2PHP &gt;=7

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20288080?v=4)[Coercive](/maintainers/Coercive)[@Coercive](https://github.com/Coercive)

---

Top Contributors

[![Coercive](https://avatars.githubusercontent.com/u/20288080?v=4)](https://github.com/Coercive "Coercive (3 commits)")

### Embed Badge

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

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

###  Alternatives

[paragonie/password_lock

Wraps Bcrypt-SHA2 in Authenticated Encryption

19350.6k1](/packages/paragonie-password-lock)[staabm/secure_dotenv

An encrypted environment configuration handler

101.0M](/packages/staabm-secure-dotenv)[psecio/secure_dotenv

An encrypted environment configuration handler

11538.7k2](/packages/psecio-secure-dotenv)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k55](/packages/open-dxp-opendxp)[thomaswelton/laravel-mcrypt-faker

Allows installation of Laravel where the PHP Mcrypt extension is not available. Provides encryption using OpenSSL, or by disabling encryption entierly.

104.0k](/packages/thomaswelton-laravel-mcrypt-faker)

PHPackages © 2026

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