middlewares / aura-session
Middleware to manage sessions using Aura.Session
Installs: 50 916
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/middlewares/aura-session
Requires
- php: ^7.2 || ^8.0
- aura/session: ^2.1
- psr/http-server-middleware: ^1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- laminas/laminas-diactoros: ^2 || ^3
- middlewares/utils: ^2 || ^3 || ^4
- oscarotero/php-cs-fixer-config: ^2
- phpstan/phpstan: ^1 || ^2
- phpunit/phpunit: ^8 || ^9
- squizlabs/php_codesniffer: ^3
README
![SensioLabs Insight][ico-sensiolabs]
Middleware to manage sessions using Aura.Session.
Requirements
- PHP >= 7.2
- A PSR-7 http message implementation (Diactoros, Guzzle, Slim, etc...)
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/aura-session.
composer require middlewares/aura-session
Example
$dispatcher = new Dispatcher([ new Middlewares\AuraSession(), function ($request) { //get the session object $session = $request->getAttribute('session'); } ]); $response = $dispatcher->dispatch(new ServerRequest());
Options
__construct(Aura\Session\SessionFactory $factory = null)
To use a custom session factory. If it's not passed, it will be created automatically.
name(string $name)
The session name. If it's not defined, the default PHPSESSID will be used.
attribute(string $attribute)
The attribute name used to store the session in the server request. By default is session.
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.