You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Rewrite README: drop dead Travis/Coveralls badges, document the PHP
7.4-8.5 support matrix, add Installation/Development/Contributing/License
sections, fix missing semicolon in the Quick Start example
- Drop php-coveralls/php-coveralls dev dep and the Coveralls upload step
from CI -- we weren't actually publishing coverage anywhere
- Set CI coverage to 'none' since we no longer emit clover output
- Regenerate composer.lock (1980 lines of transitive Symfony deps gone
with php-coveralls)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
7
+
## 0.5.1 - 2026-04-14
8
+
### Changed
9
+
- Rewrote `README.md`: dropped dead Travis and Coveralls badges, documented the supported PHP 7.4–8.5 matrix, added Installation / Development / Contributing / License sections, and fixed a missing semicolon in the Quick Start example
10
+
- Dropped `php-coveralls/php-coveralls` dev dependency and the Coveralls upload step from CI (we aren't actually publishing coverage anywhere)
11
+
- Switched CI `coverage` setup to `none` since we no longer collect clover output
Sessionz is a PHP library for smarter session management in modular applications.
4
4
5
+
## Requirements
6
+
7
+
- PHP 7.4 or newer (tested against 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, and 8.5)
8
+
-[Composer](https://getcomposer.org/)
9
+
10
+
## Installation
11
+
12
+
```bash
13
+
composer require ericmann/sessionz
14
+
```
15
+
5
16
## Quick Start
6
17
7
-
Use [Composer](https://getcomposer.org/) to add `ericmann/sessionz` to your project. Then, after loading all of your dependencies, initialize the core session manager and add the handlers you need to your stack.
18
+
After loading your autoloader, initialize the core session manager and register the handlers you need:
8
19
9
20
```php
10
21
require __DIR__ . '/vendor/autoload.php';
11
22
12
23
EAMann\Sessionz\Manager::initialize()
13
24
->addHandler( new \EAMann\Sessionz\Handlers\DefaultHandler() )
14
25
->addHandler( new \EAMann\Sessionz\Handlers\EncryptionHandler( getenv('session_passkey') ) )
15
-
->addHandler( new \EAMann\Sessionz\Handlers\MemoryHandler() )
26
+
->addHandler( new \EAMann\Sessionz\Handlers\MemoryHandler() );
16
27
17
28
session_start();
18
-
19
29
```
20
30
21
31
The above example adds, in order:
@@ -38,7 +48,7 @@ Each handler must implement the `Handler` interface so the session manager knows
38
48
39
49
### Middleware Structure
40
50
41
-
The overall structure of the handler stack is identical to that of a middleware stack in a modern PHP application. You can read more about the general philosophy [on Slim's website](https://www.slimframework.com/docs/concepts/middleware.html#how-does-middleware-work).
51
+
The overall structure of the handler stack is identical to that of a middleware stack in a modern PHP application. You can read more about the general philosophy [on Slim's website](https://www.slimframework.com/docs/v4/concepts/middleware.html).
42
52
43
53
In general, stack operations will flow from the outside-in, starting by invoking the appropriate operation on the most recently registered handler and walking down the stack to the oldest handler. Each handler has the option to halt execution and return data immediately, or can invoke the passed `$next` callback to continue operation.
Sessions stored on disk (the default implementation) or in a separate storage system (Memcache, MySQL, or similar) should be encrypted _at rest_. This handler will automatically encrypt any information passing through it on write and decrypt data on read. It does not store data on its own.
62
72
63
-
This handler requires a symmetric encryption key when it's instantiated. This key should be an ASCII-safe string, 32 bytes in length. You can easily use [Defuse PHP Encryption](https://github.com/defuse/php-encryption) (a dependency of this library) to generate a new key:
73
+
This handler requires a symmetric encryption key when it's instantiated. This key should be an ASCII-safe string generated by [Defuse PHP Encryption](https://github.com/defuse/php-encryption) (a dependency of this library):
// Store $key somewhere safe (e.g. an environment variable) and pass it
82
+
// back into the EncryptionHandler constructor on every request.
68
83
```
69
84
70
85
### `MemoryHandler`
@@ -79,11 +94,32 @@ The `BaseHandler` class is always instantiated and included at the root of the h
79
94
80
95
The `NoopHandler` class is provided for you to build additional middleware atop a standard interface that "passes through" to the next layer in the stack by default. The `EncryptionHandler`, for example, inherits from this class as it doesn't store or read data, but merely manipulates information before passing it along. Another implementation might be a logging interface to track when sessions are accessed/updated.
81
96
97
+
## Development
98
+
99
+
Clone the repository and install dev dependencies:
Static analysis is provided by [PHPStan](https://phpstan.org/) and runs automatically in CI.
114
+
115
+
## Contributing
116
+
117
+
Issues and pull requests are welcome at <https://github.com/ericmann/sessionz>. Please ensure new code is covered by tests and that `composer test` passes across the supported PHP matrix before opening a PR.
118
+
119
+
## License
120
+
121
+
[MIT](LICENSE.md)
122
+
82
123
## Credits
83
124
84
125
The middleware implementation is inspired heavily by the request middleware stack presented by [the Slim Framework](https://www.slimframework.com/).
0 commit comments