PHPackages                             session-interop/session-interop - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. session-interop/session-interop

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

session-interop/session-interop
===============================

This package contains the session interface for session interopability. It tries to standardize features in session object

3.0.0(9y ago)161.5k2MITPHPPHP &gt;=7.1.0

Since Dec 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/session-interop/session-interop)[ Packagist](https://packagist.org/packages/session-interop/session-interop)[ Docs](https://github.com/Ngob/session-interop)[ RSS](/packages/session-interop-session-interop/feed)WikiDiscussions 2.0 Synced 2mo ago

READMEChangelog (3)DependenciesVersions (6)Used By (2)

Session Interoperability
========================

[](#session-interoperability)

*session-interop* tries to identify and standardize features in *session* objet to achieve interoperability between PHP package. It does not handle session creation. Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.

If PHP projects that provide session object implementation begin to adopt these common standards, then PHP applications and projects that use session can depend on the common interfaces instead of specific implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume any session implementation that can be adapted to these interfaces.

We adhere to the spirit and ideals of PHP-FIG, and hope this project will pave the way for one or more future PSRs.

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

[](#installation)

You can install this package through Composer:

```
composer require session-interop/session-interop
```

The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility between minor versions.

Standards
---------

[](#standards)

### Available

[](#available)

[`SessionInterface`](src/Interop/Session/SessionInterface.php). Describes the interface of a Session that exposes methods to read and write its entries.

### Usage

[](#usage)

Writing an user service that use the session:

```
use Interop\Session\SessionInterface;
class UserService {
      public function isConnected(SessionInterface $session) {
       if ($session->get("userId")) {
	     	return true;
	     }
	     return false;
      }
      public function login(SessionInterface $session, $userId) {
       if ($this->isConnected($session)) {
	     	return false;
	     }
	     $session->set("userId", $userId);
	     return true;
      }
      public function logoff(SessionInterface $session) {
      if ($this->isConnected($session)) {
	     	  $session->set("userId", null);
		      return true;
	     }
	     return false;
      }
}
```

This way, the user service does not rely on a specific implementation, so you can use any session object that implements SessionInterface.

Implementations
---------------

[](#implementations)

[`ArraySession`](https://github.com/session-interop/utils.session)

A basic implementation of the interface.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

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

Total

6

Last Release

3426d ago

Major Versions

1.0.x-dev → 2.0.02016-12-23

2.0.x-dev → 3.0.02016-12-29

PHP version history (2 changes)1.0.0PHP &gt;=5.2.0

3.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1953426bdefad774b92f15505637dcf22e19f567acd596131d86ce40f738f2a?d=identicon)[Ngob](/maintainers/Ngob)

---

Top Contributors

[![Ngob](https://avatars.githubusercontent.com/u/2749238?v=4)](https://github.com/Ngob "Ngob (9 commits)")

---

Tags

phpinteroperabilitysessionphp sessioninteropsessioninterfacesession-interopsession-interface

### Embed Badge

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

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

###  Alternatives

[sandrokeil/interop-config

Provides interfaces and a concrete implementation to create instances depending on configuration via factory classes and ensures a valid config structure. It can also be used to auto discover factories and to create configuration files.

58446.7k34](/packages/sandrokeil-interop-config)

PHPackages © 2026

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