Name: php-session
Owner: Middlewares
Description: PSR-15 middleware to create a php session using the request data
Created: 2016-10-08 12:10:24.0
Updated: 2018-05-12 09:48:31.0
Pushed: 2018-05-12 09:49:18.0
Homepage: null
Size: 30
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Middleware to start a php session using the request data and close it after return the response.
This package is installable and autoloadable via Composer as middlewares/php-session.
oser require middlewares/php-session
patcher = new Dispatcher([
new Middlewares\PhpSession(),
function () {
//Use the global $_SESSION variable to get/set data
$_SESSION['name'] = 'John';
}
ponse = $dispatcher->dispatch(new ServerRequest());
name(string $name)
The session name. If it's not provided, use the php's default
id(string $id)
The session id. If it's not provided, try to get it from the request's cookies.
options(array $options)
Array of options passed to session_start()
regenerateId(int $interval, string $key = 'session-id-expires')
The session id regeneration interval in seconds. If it's 0 or not provided, sesson ID will remain unchanged.
The session id expiry timestamp key name.
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.