Download the PHP package phossa2/session without Composer
On this page you can find all versions of the php package phossa2/session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package session
phossa2/session
phossa2/session is a session library for PHP.
It requires PHP 5.4, supports PHP 7.0+ and HHVM. It is compliant with PSR-1, PSR-2, PSR-3, PSR-4, and the proposed PSR-5.
Highlights
-
Able to co-exists with other session libs or utilities including PHP session.
-
Able to run multiple sessions at the same time.
-
Data seperation using cartons.
-
validator support and dependency injection.
- Middleware support.
Installation
Install via the composer
utility.
or add the following lines to your composer.json
Usage
Start the session, normally in your bootstrap file.
Then in your code using session data,
Features
-
Phossa2\Session\Session
uses its own infra-structure. It can co-exists with other session libs or PHP session. By default, it uses cookie as session id exchange protocol. Different session then use different cookies.Close or destroy one session has no influence on other sessions.
-
In PHP session, session data is stored in the global variable
$_SESSION
. It provides storage only and there are no other utilities.Phossa2\Session\Carton
is a sandbox for data. User may name a carton box instead of using the default name'default'
. Or even attach to a different session instead of using the default session.If either
$name
or$session
is different, then the data is in different namespaces.By extending
Phossa2\Session\Carton
, user may even provide utilities, such as data locking, usage monitoring, access control etc. -
phossa2/session refactors most of its dependents into seperate classes.
Handler is implementing the most widely adopted
\SessionHandlerInterface
shipped in PHP. If no handler injected into session, it will utilize thePhossa2\Session\Handler\FileHandler
by default.Driver is implementing
Phossa2\Session\Interfaces\DriverInterface
. By default, thePhossa2\Session\Driver\CookieDriver
is used toset/get/del
session id on the client side by using cookies.Users may write their own drivers to communicate with the client.
Multiple validators may be injected into session to do validation.
By default, session id is generated by a built-in routine. User may use his own generator such as using
phossa2/uuid
.Middleware of this lib can be found in phossa2/middleware
Change log
Please see CHANGELOG from more information.
Testing
Contributing
Please see CONTRIBUTE for more information.
Dependencies
-
PHP >= 5.4.0
- phossa2/shared >= 2.0.21