Session storage in $_SESSION

Replaces the $_SESSION superglobal with an ArrayObject that allows for property access, metadata storage, locking, and immutability.

category Zend
package Zend_Session
subpackage Storage

 Methods

Constructor

__construct(array | null $input, int $flags, string $iteratorClass) 

Sets the $_SESSION superglobal to an ArrayObject, maintaining previous values if any discovered.

Parameters

$input

arraynull

$flags

int

$iteratorClass

string

Destructor

__destruct() : void

Resets $_SESSION superglobal to an array, by casting object using getArrayCopy().

append()

append() 
Inherited

inherited_from ArrayObject::append()
inherited_from \Zend\Session\Storage\ArrayStorage::append()

asort()

asort() 
Inherited

inherited_from ArrayObject::asort()
inherited_from \Zend\Session\Storage\ArrayStorage::asort()

Clear the storage object or a subkey of the object

clear(null | int | string $key) : \Zend\Session\Storage\ArrayStorage
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::clear()

Parameters

$key

nullintstring

Exceptions

\Zend\Session\Exception\RuntimeException

Returns

count()

count() 
Inherited

inherited_from ArrayObject::count()
inherited_from \Zend\Session\Storage\ArrayStorage::count()

exchangeArray()

exchangeArray() 
Inherited

inherited_from ArrayObject::exchangeArray()
inherited_from \Zend\Session\Storage\ArrayStorage::exchangeArray()

Load session object from an existing array

fromArray(array $array) : \Zend\Session\Storage\SessionStorage

Ensures $_SESSION is set to an instance of the object when complete.

Parameters

$array

array

Returns

getArrayCopy()

getArrayCopy() 
Inherited

inherited_from ArrayObject::getArrayCopy()
inherited_from \Zend\Session\Storage\ArrayStorage::getArrayCopy()

getFlags()

getFlags() 
Inherited

inherited_from ArrayObject::getFlags()
inherited_from \Zend\Session\Storage\ArrayStorage::getFlags()

getIterator()

getIterator() 
Inherited

inherited_from ArrayObject::getIterator()
inherited_from \Zend\Session\Storage\ArrayStorage::getIterator()

getIteratorClass()

getIteratorClass() 
Inherited

inherited_from ArrayObject::getIteratorClass()
inherited_from \Zend\Session\Storage\ArrayStorage::getIteratorClass()

Retrieve the request access time

getRequestAccessTime() : float
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::getRequestAccessTime()

Returns

float

Determine if this object is isImmutable

isImmutable() : bool

Returns

bool

Is the object or key marked as locked?

isLocked(null | int | string $key) : bool
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::isLocked()

Parameters

$key

nullintstring

Returns

bool

ksort()

ksort() 
Inherited

inherited_from ArrayObject::ksort()
inherited_from \Zend\Session\Storage\ArrayStorage::ksort()

Lock this storage instance, or a key within it

lock(null | int | string $key) : \Zend\Session\Storage\ArrayStorage
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::lock()

Parameters

$key

nullintstring

Returns

Mark object as isImmutable

markImmutable() : \Zend\Session\Storage\SessionStorage

natcasesort()

natcasesort() 
Inherited

inherited_from ArrayObject::natcasesort()
inherited_from \Zend\Session\Storage\ArrayStorage::natcasesort()

natsort()

natsort() 
Inherited

inherited_from ArrayObject::natsort()
inherited_from \Zend\Session\Storage\ArrayStorage::natsort()

offsetExists()

offsetExists() 
Inherited

inherited_from ArrayObject::offsetExists()
inherited_from \Zend\Session\Storage\ArrayStorage::offsetExists()

offsetGet()

offsetGet() 
Inherited

inherited_from ArrayObject::offsetGet()
inherited_from \Zend\Session\Storage\ArrayStorage::offsetGet()

offsetSet()

offsetSet(mixed $key, mixed $value) 
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::offsetSet()

Parameters

$key

mixed

$value

mixed

Exceptions

\Zend\Session\Exception\RuntimeException

offsetUnset()

offsetUnset() 
Inherited

inherited_from ArrayObject::offsetUnset()
inherited_from \Zend\Session\Storage\ArrayStorage::offsetUnset()

serialize()

serialize() 
Inherited

inherited_from ArrayObject::serialize()
inherited_from \Zend\Session\Storage\ArrayStorage::serialize()

setFlags()

setFlags() 
Inherited

inherited_from ArrayObject::setFlags()
inherited_from \Zend\Session\Storage\ArrayStorage::setFlags()

setIteratorClass()

setIteratorClass() 
Inherited

inherited_from ArrayObject::setIteratorClass()
inherited_from \Zend\Session\Storage\ArrayStorage::setIteratorClass()

Cast the object to an array

toArray() : array
Inherited

Returns data only, no metadata.

inherited_from \Zend\Session\Storage\ArrayStorage::toArray()

Returns

array

uasort()

uasort() 
Inherited

inherited_from ArrayObject::uasort()
inherited_from \Zend\Session\Storage\ArrayStorage::uasort()

uksort()

uksort() 
Inherited

inherited_from ArrayObject::uksort()
inherited_from \Zend\Session\Storage\ArrayStorage::uksort()

Unlock an object or key marked as locked

unlock(null | int | string $key) : \Zend\Session\Storage\ArrayStorage
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::unlock()

Parameters

$key

nullintstring

Returns

unserialize()

unserialize() 
Inherited

inherited_from ArrayObject::unserialize()
inherited_from \Zend\Session\Storage\ArrayStorage::unserialize()

Set the request access time

setRequestAccessTime(float $time) : \Zend\Session\Storage\ArrayStorage
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::setRequestAccessTime()

Parameters

$time

float

Returns

 Properties

 

Is storage marked isImmutable?

$isImmutable : bool
Inherited

inherited_from \Zend\Session\Storage\ArrayStorage::$$isImmutable