middlewares/php-session

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

middlewares/php-session

Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabs Insight

Middleware to start a php session using the request data and close it after return the response.

Requirements
Installation

This package is installable and autoloadable via Composer as middlewares/php-session.

oser require middlewares/php-session
Example
patcher = new Dispatcher([
new Middlewares\PhpSession(),

function () {
    //Use the global $_SESSION variable to get/set data
    $_SESSION['name'] = 'John';
}


ponse = $dispatcher->dispatch(new ServerRequest());
Options
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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.