Download the PHP package aloframework/session without Composer
On this page you can find all versions of the php package aloframework/session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aloframework/session
More information about aloframework/session
Files in aloframework/session
Package session
Short Description Redis or MySQL-based session management
License Apache-2.0
Homepage https://github.com/aloframework/session
Informations about the package session
AloFramework | Sessions
MySQL & Redis-based session management
Latest release API documentation: https://aloframework.github.io/session/
dev-develop | Latest release |
---|---|
Installation
Installation is available via Composer:
composer require aloframework/session
Additional steps for MySQL
MySQL-based sessions require an additional step which is described in setup/MySQL.md.
Usage
All sessions use the same interface (bar the constructor), in this example Redis will be used.
Logging
An instance of \Psr\Log\LoggerInterface
should be passed on to the constructor to make use of basic logging (almost everything is debug-level). If one isn't passed on, an instance of \AloFramework\Log\Log
will be created with default parameters.
Configuration
Configuration is done via the Configuration class.
Config::CFG_TIMEOUT
- session lifetime in seconds (defaults to 300)Config::CFG_COOKIE_NAME
- how the session cookie will be named (defaults to AloSession)Config::CFG_FINGERPRINT_NAME
- the session key which will hold the session-hijacking prevention fingerprint. You cannot set any session keys with the same name as that would invalidate the session. Defaults to _fp_.Config::CFG_PREFIX
- how to prefix session keys if using cache-based handlers. Defaults to _alosess.Config::CFG_SESSION_ID_ALGO
- hashing algorithm to use for session IDs. Defaults to sha512.Config::CFG_TABLE
- table to use if using MySQL-based handlers. Defaults to alo_session.Config::CFG_SECURE
- if set to true, the session cookie will only be sent via HTTPS connections (defaults totrue
).Config::CFG_GC
- garbage collection probability. If set to 100 (default) there is a 1/100 (i.e. 1% chance) that a garbage collection event will occur on session start. This is only used withMySQLNoEventSession
.Config::CFG_SAVE_CLI
- whether to save/write session data in CLI mode (default: false)Config::CFG_TOKEN
- The session key to identify token data. You must not set any session values using this key as that would invalidate the tokens. Defaults to _tk_.
All versions of session with dependencies
aloframework/common Version ^2.0
aloframework/log Version ^3.0
aloframework/config Version ^2.0