ILIAS
trunk Revision v11.0_alpha-1749-g1a06bdef097
|
Session based immediate storage. More...
Public Member Functions | |
__construct (string $a_component_id, string $a_sess_id="") | |
Constructor. More... | |
set (string $a_key, string $a_val) | |
Set a value. More... | |
get (string $a_key) | |
Static Public Member Functions | |
static | destroySession ($a_session_id) |
Destroy session(s). More... | |
Private Member Functions | |
initComponentCacheIfNotExists () | |
Private Attributes | |
string | $session_id = "" |
string | $component_id |
Static Private Attributes | |
static array | $values = [] |
Session based immediate storage.
This class stores session based user data in the database. The difference to ilSession is that data is written immediately when the set() function is called and that this data is written "per key".
Please note that the values are limited to TEXT(1000)!
This class is needed for cases, where ajax calls should write session based data.
Since more concurrent ajax calls can be initiated by a page request, these calls may run into race conditions, if ilSession is used, since it always reads all key/value pairs at the beginning of a request and writes all of them at the end. Similar issues can appear if a page initiates additional requests by (i)frames.
Definition at line 41 of file class.ilSessionIStorage.php.
ilSessionIStorage::__construct | ( | string | $a_component_id, |
string | $a_sess_id = "" |
||
) |
Constructor.
string | $a_component_id | component id (e.g. "crs", "lm", ...) |
string | $a_sess_id | session id |
Definition at line 53 of file class.ilSessionIStorage.php.
|
static |
Destroy session(s).
This is called by ilSession->destroy
$a_session_id | string|array ids of sessions to be deleted |
Definition at line 129 of file class.ilSessionIStorage.php.
Referenced by ilSession\_destroy().
ilSessionIStorage::get | ( | string | $a_key | ) |
string | $a_key |
Definition at line 99 of file class.ilSessionIStorage.php.
References $component_id, $DIC, $ilDB, and initComponentCacheIfNotExists().
|
private |
Definition at line 63 of file class.ilSessionIStorage.php.
References $component_id.
Referenced by get(), and set().
ilSessionIStorage::set | ( | string | $a_key, |
string | $a_val | ||
) |
Set a value.
string | $a_val | value |
Definition at line 75 of file class.ilSessionIStorage.php.
References $component_id, $DIC, $ilDB, and initComponentCacheIfNotExists().
|
private |
Definition at line 44 of file class.ilSessionIStorage.php.
Referenced by get(), initComponentCacheIfNotExists(), and set().
|
private |
Definition at line 43 of file class.ilSessionIStorage.php.
|
staticprivate |
Definition at line 45 of file class.ilSessionIStorage.php.