Class ElggSession
Magic session class. This class is intended to extend the $_SESSION magic
variable by providing an API hook to plug in other values.
Primarily this is intended to provide a way of supplying "logged in user"
details without touching the session (which can cause problems when accessed
server side).
If a value is present in the session then that value is returned, otherwise a
plugin hook 'session:get', '$var' is called, where $var is the variable being
requested.
Setting values will store variables in the session in the normal way.
LIMITATIONS: You can not access multidimensional arrays
-
ElggSession
implements
ArrayAccess
Methods summary
public
boolean
|
#
__isset( string $key )
Test if property is set either as an attribute or metadata.
Test if property is set either as an attribute or metadata.
Parameters
- $key
string $key The name of the attribute or metadata.
Returns
boolean
|
public
|
#
offsetSet( string $key, mixed $value )
Set a value, go straight to session.
Set a value, go straight to session.
Parameters
- $key
string $key Name
- $value
mixed $value Value
Implementation of
|
public
mixed
|
#
offsetGet( mixed $key )
Get a variable from either the session, or if its not in the session attempt
to get it from an api call.
Get a variable from either the session, or if its not in the session attempt
to get it from an api call.
Parameters
Returns
mixed
See
Implementation of
|
public
|
#
offsetUnset( mixed $key )
Unset a value from the cache and the session.
Unset a value from the cache and the session.
Parameters
See
Implementation of
|
public
boolean
|
#
offsetExists( integer $offset )
Return whether the value is set in either the session or the cache.
Return whether the value is set in either the session or the cache.
Parameters
- $offset
integer $offset Offset
Returns
boolean
See
Implementation of
|
public
mixed
|
#
get( string $key )
Alias to ::offsetGet()
Parameters
Returns
mixed
|
public
|
#
set( string $key, mixed $value )
Alias to ::offsetSet()
Parameters
- $key
string $key Name
- $value
mixed $value Value
|
public
|
#
del( string $key )
Alias to offsetUnset()
Parameters
|