SessionNamespace
extends AbstractSession
in package
Session namespace class
Tags
Table of Contents
Properties
- $namespace : string|null
- Session namespace
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Get method to return the value of the $_SESSION global variable
- __isset() : bool
- Return the isset value of the $_SESSION global variable
- __set() : void
- Set a property in the session object that is linked to the $_SESSION global variable
- __unset() : void
- Unset the $_SESSION global variable
- count() : int
- Method to get the count of data in the session
- getIterator() : ArrayIterator
- Method to iterate over the session
- getNamespace() : string
- Get current namespace
- kill() : void
- Kill the session namespace
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- setNamespace() : SessionNamespace
- Set current namespace
- setRequestValue() : SessionNamespace
- Set a request-based value
- setTimedValue() : SessionNamespace
- Set a time-based value
- toArray() : array<string|int, mixed>
- Get the session values as an array
- checkExpiration() : void
- Check the time-based session value
- checkExpirations() : void
- Check the time-based session values
- checkRequest() : void
- Check the request-based session value
- checkRequests() : void
- Check the request-based session values
- init() : void
- Init the session
Properties
$namespace
Session namespace
private
string|null
$namespace
= null
Methods
__construct()
Constructor
public
__construct(string $namespace) : mixed
Private method to instantiate the session object
Parameters
- $namespace : string
Tags
__get()
Get method to return the value of the $_SESSION global variable
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
Return the isset value of the $_SESSION global variable
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
Set a property in the session object that is linked to the $_SESSION global variable
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__unset()
Unset the $_SESSION global variable
public
__unset(string $name) : void
Parameters
- $name : string
count()
Method to get the count of data in the session
public
count() : int
Return values
intgetIterator()
Method to iterate over the session
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetNamespace()
Get current namespace
public
getNamespace() : string
Return values
stringkill()
Kill the session namespace
public
kill([bool $all = false ]) : void
Parameters
- $all : bool = false
offsetExists()
ArrayAccess offsetExists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
ArrayAccess offsetGet
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
ArrayAccess offsetSet
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
ArrayAccess offsetUnset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
setNamespace()
Set current namespace
public
setNamespace(string $namespace) : SessionNamespace
Parameters
- $namespace : string
Return values
SessionNamespacesetRequestValue()
Set a request-based value
public
setRequestValue(string $key, mixed $value[, int $hops = 1 ]) : SessionNamespace
Parameters
- $key : string
- $value : mixed
- $hops : int = 1
Return values
SessionNamespacesetTimedValue()
Set a time-based value
public
setTimedValue(string $key, mixed $value[, int $expire = 300 ]) : SessionNamespace
Parameters
- $key : string
- $value : mixed
- $expire : int = 300
Return values
SessionNamespacetoArray()
Get the session values as an array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>checkExpiration()
Check the time-based session value
private
checkExpiration(mixed $key) : void
Parameters
- $key : mixed
checkExpirations()
Check the time-based session values
private
checkExpirations() : void
checkRequest()
Check the request-based session value
private
checkRequest(mixed $key) : void
Parameters
- $key : mixed
checkRequests()
Check the request-based session values
private
checkRequests() : void
init()
Init the session
private
init() : void