2017 © Pedro Peláez
 

library sessions

image

laasti/sessions

  • Tuesday, January 10, 2017
  • by nebulousGirl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 82 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

Laasti/Sessions

A nice simple session abstraction that works with PSR7 Http Message., (*1)

Installation

composer require laasti/sessions

Usage

The package by default stores sessions to filesystem and persists sessions with cookies., (*2)

A middleware is responsible to insert the session in the request and to persist it in the response., (*3)

The middleware uses a HttpPersisterInterface which does all the background work to manipulate requests and responses., (*4)

**A word of caution the id of a session is immutable. Changing the id with withSessionId results in a new instance., (*5)

For that reason, it is recommended that only middlewares should mess with the session id and each middleware is responsible for the persistence of its new session., (*6)

To ease the process, you can easily reuse the persister across multiple middlewares in case you need to regenerate the session., (*7)

The default Cookie persister does not overwrite the cookie if it already exists in the response., (*8)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

See Github's releases, or tags, (*9)

Credits

Author: Sonia Marquette (@nebulousGirl), (*10)

License

Released under the MIT License. See LICENSE.txt file., (*11)

The Versions