Defines common constructor logic and getters for Storage and Configuration
Methods
Constructor
__construct(\Zend\Session\Config\ConfigInterface $config, \Zend\Session\Storage\StorageInterface $storage, \Zend\Session\SaveHandler\SaveHandlerInterface $saveHandler, array $validators)
Parameters
$validators
array
Exceptions
Destroy/end a session
destroy(array $options) : void
Parameters
$options
array
See {@link $defaultDestroyOptions}
Expire the session cookie
expireSessionCookie() : void
Sends a session cookie with no value, and with an expiry in the past.
Get session ID
getId() : string
Get session name
getName() : string
Is this session valid?
isValid() : bool
Notifies the Validator Chain until either all validators have returned
true or one has failed.
Returns
bool
Regenerate id
regenerateId(bool $deleteOldSession) : \Zend\Session\SessionManager
Regenerate the session ID, using session save handler's
native ID generation Can safely be called in the middle of a session.
Parameters
$deleteOldSession
bool
Returns
Set the TTL (in seconds) for the session cookie expiry
rememberMe(null | int $ttl) : \Zend\Session\SessionManager
Can safely be called in the middle of a session.
Parameters
$ttl
nullint
Returns
Does a session exist and is it currently active?
sessionExists() : bool
Set configuration object
setConfig(\Zend\Session\Config\ConfigInterface $config) : \Zend\Session\AbstractManager
Inherited
inherited_from |
\Zend\Session\AbstractManager::setConfig() |
Parameters
Returns
Set session ID
setId(string $id) : \Zend\Session\SessionManager
Can safely be called in the middle of a session.
Parameters
$id
string
Returns
Attempt to set the session name
setName(string $name) : \Zend\Session\SessionManager
If the session has already been started, or if the name provided fails
validation, an exception will be raised.
Parameters
$name
string
Exceptions
Returns
Set session save handler object
setSaveHandler(\Zend\Session\SaveHandler\SaveHandlerInterface $saveHandler) : \Zend\Session\AbstractManager
Inherited
inherited_from |
\Zend\Session\AbstractManager::setSaveHandler() |
Parameters
Returns
Set session storage object
setStorage(\Zend\Session\Storage\StorageInterface $storage) : \Zend\Session\AbstractManager
Inherited
inherited_from |
\Zend\Session\AbstractManager::setStorage() |
Parameters
Returns
Set the validator chain to use when validating a session
setValidatorChain(\Zend\EventManager\EventManagerInterface $chain) : \Zend\Session\SessionManager
In most cases, you should use an instance of ValidatorChain.
Parameters
Returns
Start session
start(bool $preserveStorage) : void
if No session currently exists, attempt to start it. Calls
isValid() once session_start() is called, and raises an
exception if validation fails.
Parameters
$preserveStorage
bool
If set to true, current session storage will not be overwritten by the contents of $_SESSION.
Exceptions
Write session to save handler and close
writeClose() : void
Once done, the Storage object will be marked as isImmutable.
Create validators, insert reference value and add them to the validator chain
initializeValidatorChain()
Register Save Handler with ext/session
registerSaveHandler(\Zend\Session\SaveHandler\SaveHandlerInterface $saveHandler) : bool
Since ext/session is coupled to this particular session manager
register the save handler with ext/session.
Parameters
Returns
bool
Set the session cookie lifetime
setSessionCookieLifetime(int $ttl) : void
If a session already exists, destroys it (without sending an expiration
cookie), regenerates the session ID, and restarts the session.
Parameters
$ttl
int
Properties
Default configuration class to use when no configuration provided
$defaultConfigClass : string
Inherited
inherited_from |
\Zend\Session\AbstractManager::$$defaultConfigClass |
Default options when a call to {@link destroy()} is made
- send_expire_cookie: whether or not to send a cookie expiring the current session cookie
- clear_storage: whether or not to empty the storage object of any stored values
$defaultDestroyOptions : array
Default storage class to use when no storage provided
$defaultStorageClass : string
Inherited
inherited_from |
\Zend\Session\AbstractManager::$$defaultStorageClass |
<p>value returned by session_name()</p>
$name : string
$validators
$validators : array
Inherited
inherited_from |
\Zend\Session\AbstractManager::$$validators |