PHPackages                             caridea/session - 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. caridea/session

ActiveLibrary[Security](/categories/security)

caridea/session
===============

A shrimp of a session library

3.0.0(8y ago)06621Apache-2.0PHPPHP &gt;=7.1.0

Since Jun 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/libreworks/caridea-session)[ Packagist](https://packagist.org/packages/caridea/session)[ Docs](http://github.com/libreworks/caridea-session)[ RSS](/packages/caridea-session/feed)WikiDiscussions master Synced 1mo ago

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

caridea-session
===============

[](#caridea-session)

Caridea is a miniscule PHP application library. This shrimpy fellow is what you'd use when you just want some helping hands and not a full-blown framework.

[![](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)

This is the session component. It's used for controlling sessions (e.g. starting, resuming, destroying) as well as storing namespaced values within a session.

It supports plugins that get notified of session events. Included in this package are a CSRF prevention plugin and a "flash message" plugin.

[![Packagist](https://camo.githubusercontent.com/b91617df297befa76c920ce3276071ad64746585ea4db81324519073afde8582/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172696465612f73657373696f6e2e737667)](https://packagist.org/packages/caridea/session)[![Build Status](https://camo.githubusercontent.com/35f6aed9d562cf515babc5d0ef31bba9dbf3e8b216b7cec7d30659102a5e8a22/68747470733a2f2f7472617669732d63692e6f72672f6c69627265776f726b732f636172696465612d73657373696f6e2e737667)](https://travis-ci.org/libreworks/caridea-session)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f1c6fb6a80e40fe319500887c37089758ab8da7ca14ee94f6060821c164f2e65/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d73657373696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-session/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/ed69bc53d31001d8e4d5886cab424e4cbfb07411584c5f47c7a0fb1960736d5b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d73657373696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-session/?branch=master)

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

[](#installation)

You can install this library using Composer:

```
$ composer require caridea/session
```

- The master branch (version 3.x) of this project requires PHP 7.1 and has no dependencies
- Version 2.x of this project requires PHP 7.0 and has no dependencies
- Version 1.x of this project requires PHP 5.5 and depends on `caridea/random`.

Compliance
----------

[](#compliance)

Releases of this library will conform to [Semantic Versioning](http://semver.org).

Our code is intended to comply with [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/). If you find any issues related to standards compliance, please send a pull request!

Documentation
-------------

[](#documentation)

- Head over to [Read the Docs](http://caridea-session.readthedocs.io/en/latest/)

Examples
--------

[](#examples)

Just a few quick examples.

Creating a Session.

```
// When the session starts, a CSRF token will be created and stored
$csrf = new \Caridea\Session\CsrfPlugin();
// Display-once messages can be added using the flash plugin
$flash = new \Caridea\Session\FlashPlugin();
$session = new \Caridea\Session\NativeSession($_COOKIE, [$csrf, $flash]);

$session->resume() || $session->start();

$flash->set('foo', 'bar');

$token = $csrf->getValue();

$values = $session->getValues('my-namespace');
$values['foobar'] = 'abc123';
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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

Recently: every ~163 days

Total

7

Last Release

3054d ago

Major Versions

0.1.0 → 1.0.02016-03-21

1.x-dev → 2.0.02016-03-22

2.0.x-dev → 3.0.02018-01-06

PHP version history (3 changes)0.1.0PHP &gt;=5.5.0

2.0.0PHP &gt;=7.0.0

3.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/659262eac941ffe4795493834425fc9a2369c2c9df3cc565ed4194f1d37be934?d=identicon)[doublecompile](/maintainers/doublecompile)

---

Top Contributors

[![doublecompile](https://avatars.githubusercontent.com/u/4267230?v=4)](https://github.com/doublecompile "doublecompile (28 commits)")

---

Tags

sessionflashflash messagesessionscsrf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/caridea-session/health.svg)

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

###  Alternatives

[aura/session

Provides session management functionality, including lazy session starting, session segments, next-request-only ("flash") values, and CSRF tools.

2041.2M69](/packages/aura-session)[paragonie/anti-csrf

Paragon Initiative's Anti-CSRF Security Library

307200.6k5](/packages/paragonie-anti-csrf)[owasp/csrf-protector-php

CSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app.

222348.3k4](/packages/owasp-csrf-protector-php)[kunststube/csrfp

A signed token generator for cross site request forgery protection.

52209.5k1](/packages/kunststube-csrfp)[riimu/kit-csrf

Secure and simple CSRF library protected against timing and BREACH attacks

6526.1k](/packages/riimu-kit-csrf)[ayesh/stateless-csrf

Secret-key based state-less CSRF token generator and validator for PHP 8. State-less means you do not have to store the CSRF token in session or database.

3223.3k](/packages/ayesh-stateless-csrf)

PHPackages © 2026

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