Session storage container
Allows for interacting with session storage in isolated containers, which may have their own expiries, or even expiries per key in the container. Additionally, expiries may be absolute TTLs or measured in "hops", which are based on how many times the key or container were accessed.
package | Default |
---|---|
inherited_from | \Zend\Stdlib\ArrayObject |
__construct(null|string $name= 'Default'
, \Zend\Session\ManagerInterface $manager= null
)
Provide a name ('Default' if none provided) and a ManagerInterface instance.
inherited_from | \Zend\Stdlib\ArrayObject::__construct() |
---|
null
string
\Zend\Session\ManagerInterface
\Zend\Session\Exception\InvalidArgumentException |
---|
__construct(array $input= array()
, integer $flags= self::STD_PROP_LIST
, string $iteratorClass= 'ArrayIterator'
)
array
integer
string
__get(mixed $key) : mixed
mixed
mixed
__isset(mixed $key) : boolean
mixed
boolean
__set(mixed $key, mixed $value) : void
mixed
mixed
__unset(mixed $key) : void
mixed
append(mixed $value) : void
mixed
asort() : void
count() : integer
integer
exchangeArray(array|object $input) : array
exchangeArray(array|\Zend\Stdlib\ArrayObject $data) : array
array
\Zend\Stdlib\ArrayObject
array
getArrayCopy() : array
inherited_from | \Zend\Stdlib\ArrayObject::getArrayCopy() |
---|
array
getArrayCopy() : array
array
getDefaultManager() : \Zend\Session\ManagerInterface
If none provided, instantiates one of type \$managerDefaultClass
\Zend\Session\Exception\InvalidArgumentException |
if invalid manager default class provided |
---|
\Zend\Session\ManagerInterface
getFlags() : integer
integer
getIterator() : \Iterator
inherited_from | \Zend\Stdlib\ArrayObject::getIterator() |
---|
\Iterator
getIterator() : \Iterator
\Iterator
getIteratorClass() : string
string
getManager() : \Zend\Session\ManagerInterface
\Zend\Session\ManagerInterface
getName() : string
string
ksort() : void
natcasesort() : void
natsort() : void
offsetExists(string $key) : boolean
inherited_from | \Zend\Stdlib\ArrayObject::offsetExists() |
---|
string
boolean
offsetExists(mixed $key) : boolean
mixed
boolean
offsetGet(string $key) : mixed
inherited_from | \Zend\Stdlib\ArrayObject::offsetGet() |
---|
string
mixed
offsetGet(mixed $key) : mixed
mixed
mixed
offsetSet(string $key, mixed $value) : void
inherited_from | \Zend\Stdlib\ArrayObject::offsetSet() |
---|
string
mixed
offsetSet(mixed $key, mixed $value) : void
mixed
mixed
offsetUnset(string $key) : void
inherited_from | \Zend\Stdlib\ArrayObject::offsetUnset() |
---|
string
offsetUnset(mixed $key) : void
mixed
serialize() : string
string
setDefaultManager(\Zend\Session\ManagerInterface $manager = null
) : void
\Zend\Session\ManagerInterface
setExpirationHops(integer $hops, null|string|array $vars = null
) : \Zend\Session\Container
integer
null
string
array
\Zend\Session\Exception\InvalidArgumentException |
---|
\Zend\Session\Container
setExpirationSeconds(integer $ttl, string|array|null $vars = null
) : \Zend\Session\Container
Set the TTL for the entire container, a single key, or a set of keys.
integer
TTL in seconds
string
array
null
\Zend\Session\Exception\InvalidArgumentException |
---|
\Zend\Session\Container
setFlags(integer $flags) : void
integer
setIteratorClass(string $class) : void
string
uasort(callable $function) : void
callable
uksort(callable $function) : void
callable
unserialize(string $data) : void
string
createContainer() : \Zend\Stdlib\ArrayObject
\Zend\Stdlib\ArrayObject
expireByExpiryTime(\Zend\Session\Storage\StorageInterface $storage, string $name, string $key) : boolean
Checks to see if the entire container has expired based on TTL setting, or the individual key.
\Zend\Session\Storage\StorageInterface
string
Container name
string
Key in container to check
boolean
expireByHops(\Zend\Session\Storage\StorageInterface $storage, string $name, string $key) : boolean
Determines whether the container or an individual key within it has expired based on session hops
\Zend\Session\Storage\StorageInterface
string
string
boolean
expireKeys(null|string $key = null
) : boolean
Returns true if the key has expired, false otherwise.
null
string
boolean
getStorage() : \Zend\Session\Storage\StorageInterface
Proxies to ManagerInterface::getStorage()
\Zend\Session\Storage\StorageInterface
setManager(null|\Zend\Session\ManagerInterface $manager = null
) : \Zend\Session\Container
null
\Zend\Session\ManagerInterface
\Zend\Session\Exception\InvalidArgumentException |
---|
\Zend\Session\Container
verifyNamespace(boolean $createContainer = true
) : \Zend\Session\Storage\StorageInterface | null
Checks to see if a container exists within the Storage object already. If not, one is created; if so, checks to see if it's an ArrayObject. If not, it raises an exception; otherwise, it returns the Storage object.
boolean
Whether or not to create the container for the namespace
\Zend\Session\Exception\RuntimeException |
---|
\Zend\Session\Storage\StorageInterface
null
Returns null only if $createContainer is false$defaultManager : \Zend\Session\ManagerInterface
$flag : integer
$iteratorClass : string
$manager : \Zend\Session\ManagerInterface
$managerDefaultClass : string
'Zend\\Session\\SessionManager'
$name : string
$protectedProperties : array
$storage : array
ARRAY_AS_PROPS = 2
STD_PROP_LIST = 1