DATA Methods
Database functions
select(), fetch(), write(), update(), delete(), execute(), tables(), fields()Requests and temporary storage
request(), cookie(), session(), config(), store()Formatting data
encode(), decode(), json(), text(), date(), weekday(), month()Template data
content(), parents(), directory()
session()
Reads and writes session values. The function may also be used with one of the system identifiers shown in the parameters section below.
mixed session([ string ident [, mixed value [, bool secure = false ]]])
Return
Returns string type session value. If no identifier was passed function will return an array containing all session values.
Parameter
Description
identName of variable for which the values is to be stored. If no identifier is passed, function will return array containing all session values. You may also use one of these system-identifiers:
SYS_SESSION_DEL: delete all session information
SYS_SESSION_IDX: get session-id
The values of those system-identifiers are read-only!!
SYS_SESSION_DEL: delete all session information
SYS_SESSION_IDX: get session-id
The values of those system-identifiers are read-only!!
valueValue to be stored in session. If no value is passed function will return current session value. Do not try to store an array as a session value. Please note that function will always return string type value.
secureUse the secure-flag with all data that might be vulnerable to session hijacking. This way the data will be validated by an internal ID and the current IP-address.
Read session value
$DATA->session('test')
RETURN: NULL
Increase session value
$DATA->session('test', intval($DATA->session('test')) +1)
RETURN: 1