Session ManagerInterface implementation utilizing ext/session.
More...
Session ManagerInterface implementation utilizing ext/session.
__construct |
( |
Config\ConfigInterface |
$config = null , |
|
|
Storage\StorageInterface |
$storage = null , |
|
|
SaveHandler\SaveHandlerInterface |
$saveHandler = null , |
|
|
array |
$validators = array() |
|
) |
| |
Constructor.
- Parameters
-
Config\ConfigInterface | null | $config | |
Storage\StorageInterface | null | $storage | |
SaveHandler\SaveHandlerInterface | null | $saveHandler | |
array | $validators | |
- Exceptions
-
Exception\RuntimeException | |
destroy |
( |
array |
$options = null | ) |
|
Destroy/end a session.
- Parameters
-
- Returns
- void
Expire the session cookie.
Sends a session cookie with no value, and with an expiry in the past.
- Returns
- void
Implements ManagerInterface.
Get the validator chain to use when validating a session.
By default, uses an instance of ValidatorChain.
- Returns
- EventManagerInterface
Implements ManagerInterface.
initializeValidatorChain |
( |
| ) |
|
|
protected |
Create validators, insert reference value and add them to the validator chain.
Is this session valid?
Notifies the Validator Chain until either all validators have returned true or one has failed.
- Returns
- bool
Implements ManagerInterface.
regenerateId |
( |
|
$deleteOldSession = true | ) |
|
Regenerate id.
Regenerate the session ID, using session save handler's native ID generation Can safely be called in the middle of a session.
- Parameters
-
- Returns
- SessionManager
registerSaveHandler |
( |
SaveHandler\SaveHandlerInterface |
$saveHandler | ) |
|
|
protected |
Register Save Handler with ext/session.
Since ext/session is coupled to this particular session manager register the save handler with ext/session.
- Parameters
-
SaveHandler\SaveHandlerInterface | $saveHandler | |
- Returns
- bool
rememberMe |
( |
|
$ttl = null | ) |
|
Set the TTL (in seconds) for the session cookie expiry.
Can safely be called in the middle of a session.
- Parameters
-
- Returns
- SessionManager
Implements ManagerInterface.
Does a session exist and is it currently active?
- Returns
- bool
Implements ManagerInterface.
Attempt to set the session name.
If the session has already been started, or if the name provided fails validation, an exception will be raised.
- Parameters
-
- Returns
- SessionManager
- Exceptions
-
Exception\InvalidArgumentException | |
Implements ManagerInterface.
setSessionCookieLifetime |
( |
|
$ttl | ) |
|
|
protected |
Set the session cookie lifetime.
If a session already exists, destroys it (without sending an expiration cookie), regenerates the session ID, and restarts the session.
- Parameters
-
- Returns
- void
start |
( |
|
$preserveStorage = false | ) |
|
Start session.
if No session currently exists, attempt to start it. Calls isValid() once session_start() is called, and raises an exception if validation fails.
- Parameters
-
bool | $preserveStorage | If set to true, current session storage will not be overwritten by the contents of $_SESSION. |
- Returns
- void
- Exceptions
-
Exception\RuntimeException | |
Write session to save handler and close.
Once done, the Storage object will be marked as isImmutable.
- Returns
- void
Implements ManagerInterface.
Initial value:= array(
'send_expire_cookie' => true,
'clear_storage' => false,
)