2017 © Pedro Peláez
 

library session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

image

ellipse/session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

  • Thursday, March 29, 2018
  • by pmall
  • Repository
  • 1 Watchers
  • 0 Stars
  • 75 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Session start

This package provides a Psr-15 middleware allowing to use session with Psr-7 request and response., (*1)

Require php >= 7.0, (*2)

Installation composer require ellipse/session-start, (*3)

Run tests ./vendor/bin/kahlan, (*4)

Using the start session middleware

This middleware use the default php session mechanism adapted to Psr-7 request and response flow. The default php session cookie is disabled and the session id is manually stored in a cookie readed from the Psr-7 request and attached to the Psr-7 response., (*5)

By default values returned by session_name() and session_get_cookie_params are used to build the session cookie. An optional array of options can be given to the middleware in order to overwrite those default values:, (*6)

  • (string) name: the session cookie name
  • (string) path: the session cookie path
  • (string) domain: the session cookie domain
  • (int) lifetime: the session cookie lifetime in second
  • (bool) secure: whether the session cookie should only be sent over secure connections
  • (bool) httponly: whether the session cookie can only be accessed through the HTTP protocol

The middleware can of course be used after the SessionHandlerMiddleware from ellipse/session-handler in order to use a custom session handler., (*7)

<?php

namespace App;

use Ellipse\Session\StartSessionMiddleware;

// All middleware processed after this one will have acces to the $_SESSION data.
// The session cookie name will by 'my_session_cookie'. See above for other options.
$middleware = new StartSessionMiddleware([
    'name' => 'my_session_cookie',
]);

The Versions

29/03 2018

dev-master

9999999-dev https://github.com/ellipsephp/session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware psr-7 request response session psr-15

23/02 2018

1.0.3

1.0.3.0 https://github.com/ellipsephp/session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware session psr-15

23/01 2018

1.0.2

1.0.2.0 https://github.com/ellipsephp/session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware psr-7 request response session psr-15

20/11 2017

1.0.1

1.0.1.0 https://github.com/ellipsephp/session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware psr-7 request response session psr-15

18/11 2017

1.0.0

1.0.0.0 https://github.com/ellipsephp/session-start

Psr-15 middleware allowing to use session with Psr-7 request and response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware psr-7 request response session psr-15