PHPackages                             sbe1/signedcookielib - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sbe1/signedcookielib

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

sbe1/signedcookielib
====================

Simple library for creating and validating custom session/token cookies that use a cryptographic signature for verification.

12PHP

Since Oct 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sbe1/signedcookielib)[ Packagist](https://packagist.org/packages/sbe1/signedcookielib)[ RSS](/packages/sbe1-signedcookielib/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Signed-Cookie-Lib
=================

[](#signed-cookie-lib)

Simple library for creating and validating custom session/token cookies that use a cryptographic signature for verification.

```
# Usage:
$expires = time()+3600;
$path = '/';
$domain = '.example.com';
$key = 'a cryptographically strong key for HMAC hashes.';
$algo = 'sha256';

$name = 'EXAMPLE_SESSION';
$value = 'An unsigned string.';

# Create signed cookie.

$c = new SignedCookieLib($expires, $path, $domain, $key, $algo);

$c->setCookie($name, $value)

```

```
# Cookie validation example.

$c = new SignedCookieLib($expires, $path, $domain, $key, $algo);
$result = $c->isValid($cookieName, $cookieUnsignedValue);

```

You can use this as an alternative method of validating logged in users with a private key or use this as a simple validation method for changing account passwords and other uses where you might like to use secure validation without dependence on a user information database or other data source.

Installation
============

[](#installation)

composer require sbe1/signedcookielib dev-master

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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.

### Community

Maintainers

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

---

Top Contributors

[![sbe1](https://avatars.githubusercontent.com/u/734147?v=4)](https://github.com/sbe1 "sbe1 (11 commits)")

### Embed Badge

![Health badge](/badges/sbe1-signedcookielib/health.svg)

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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