Session
in package
FinalYes
Legacy session persistence helper backed by cookies and the slothsoft DBMS layer.
Included for historical compatibility only. This API is deprecated and should not be used in new code.
Tags
Table of Contents
Constants
- GLOBAL_SESSION : mixed = null
Properties
- $cookieName : string
- $data : array<string|int, mixed>|null
- $dbmsTable : Table|null
- $dbName : string
- $hashList : array<string|int, string>
- $initialized : bool
- $key : string|null
- $tableName : string
Methods
- __construct() : mixed
- getCookie() : mixed
- getDataValue() : mixed
- getGlobalValue() : mixed
- setCookie() : void
- setDataValue() : void
- setGlobalValue() : void
- decodeData() : mixed
- encodeData() : string|false
- generateKey() : string
- hash() : string
- init() : void
- initKey() : void
- install() : void
- loadData() : mixed
- saveData() : void
Constants
GLOBAL_SESSION
public
mixed
GLOBAL_SESSION
= null
Properties
$cookieName
protected
string
$cookieName
= 'session-key'
$data
protected
array<string|int, mixed>|null
$data
= null
$dbmsTable
protected
Table|null
$dbmsTable
= null
$dbName
protected
string
$dbName
= 'cms'
$hashList
protected
static array<string|int, string>
$hashList
= []
$initialized
protected
bool
$initialized
$key
protected
string|null
$key
= null
$tableName
protected
string
$tableName
= 'session'
Methods
__construct()
public
__construct() : mixed
getCookie()
public
getCookie(string $key[, mixed $val = null ]) : mixed
Parameters
- $key : string
- $val : mixed = null
getDataValue()
public
getDataValue(string $key[, mixed $val = null ]) : mixed
Parameters
- $key : string
- $val : mixed = null
getGlobalValue()
public
getGlobalValue(string $key[, mixed $val = null ]) : mixed
Parameters
- $key : string
- $val : mixed = null
setCookie()
public
setCookie(string $key[, string|null $val = null ]) : void
Parameters
- $key : string
- $val : string|null = null
setDataValue()
public
setDataValue(string $key[, mixed $val = null ]) : void
Parameters
- $key : string
- $val : mixed = null
setGlobalValue()
public
setGlobalValue(string $key[, mixed $val = null ]) : void
Parameters
- $key : string
- $val : mixed = null
decodeData()
protected
decodeData(string $data) : mixed
Parameters
- $data : string
encodeData()
protected
encodeData(mixed $data) : string|false
Parameters
- $data : mixed
Return values
string|falsegenerateKey()
protected
generateKey() : string
Return values
stringhash()
protected
hash(string $name) : string
Parameters
- $name : string
Return values
stringinit()
protected
init() : void
initKey()
protected
initKey([string|null $key = null ]) : void
Parameters
- $key : string|null = null
install()
protected
install(Table $table) : void
Parameters
- $table : Table
loadData()
protected
loadData(string|null $session, string $key, mixed $val) : mixed
Parameters
- $session : string|null
- $key : string
- $val : mixed
saveData()
protected
saveData(string|null $session, string $key, mixed $val) : void
Parameters
- $session : string|null
- $key : string
- $val : mixed