SESSION
in package
SESSION
Common session functions
Table of Contents
Methods
- __construct() : mixed
- SESSION
- clearArray() : void
- Clear session variables named with $prefix
- clearSessionData() : void
- Clear all user sessions (other than setup_) in case this user has been logging on and off as different users
- delVar() : void
- Delete a session variable
- destroy() : void
- Destroy the whole session
- getArray() : array<string|int, mixed>
- Return an associative array of all session variables starting with $prefix_.
- getVar() : mixed
- Get a session variable
- issetVar() : bool
- Is a session variable set?
- setVar() : bool
- Set a session variable
- writeArray() : bool
- Write to session variables named with $prefix_ the given associative array.
Methods
__construct()
SESSION
public
__construct() : mixed
clearArray()
Clear session variables named with $prefix
public
clearArray(string $prefix) : void
Parameters
- $prefix : string
clearSessionData()
Clear all user sessions (other than setup_) in case this user has been logging on and off as different users
public
clearSessionData() : void
delVar()
Delete a session variable
public
delVar(string $key) : void
Parameters
- $key : string
destroy()
Destroy the whole session
public
destroy() : void
getArray()
Return an associative array of all session variables starting with $prefix_.
public
getArray(string $prefix) : array<string|int, mixed>
key in returned array is minus the prefix to aid in matching database table fields.
Parameters
- $prefix : string
Return values
array<string|int, mixed>getVar()
Get a session variable
public
getVar(string $key[, mixed $defaultValue = false ]) : mixed
Parameters
- $key : string
- $defaultValue : mixed = false
-
Value returned if the variable session is not set, default is FALSE (keep compatibility with old WKX ver. <= 5)
Return values
mixed —The value of the key, if exists, or the value of $defaultValue
issetVar()
Is a session variable set?
public
issetVar(string $key) : bool
Parameters
- $key : string
Return values
boolsetVar()
Set a session variable
public
setVar(string $key, string $value) : bool
Parameters
- $key : string
- $value : string
Return values
boolwriteArray()
Write to session variables named with $prefix_ the given associative array.
public
writeArray(array<string|int, mixed> $array[, string $prefix = '' ][, bool $keepZero = false ]) : bool
Parameters
- $array : array<string|int, mixed>
- $prefix : string = ''
-
Default is ''
- $keepZero : bool = false
-
If TRUE, array values that are 0 will be stored as 0 rather than FALSE. Default is FALSE