Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Database based session handler. More...
Public Member Functions | |
__construct () | |
Create new instance of handler. | |
handler_close () | |
Close session handler. More... | |
handler_destroy ($sid) | |
Destroy session handler. More... | |
handler_gc ($ignored_maxlifetime) | |
GC session handler. More... | |
handler_open ($save_path, $session_name) | |
Open session handler. More... | |
handler_read ($sid) | |
Read session handler. More... | |
handler_write ($sid, $session_data) | |
Write session handler. More... | |
init () | |
Init session handler. | |
kill_all_sessions () | |
Kill all active sessions, the core sessions table is purged afterwards. | |
kill_session ($sid) | |
Kill one session, the session record is removed afterwards. More... | |
session_exists ($sid) | |
Check the backend contains data for this session id. More... | |
start () | |
Start the session. More... | |
Protected Attributes | |
int | $acquiretimeout = 120 |
$acquiretimeout how long to wait for session lock | |
moodle_database | $database = null |
$database session database | |
bool | $failed = false |
$failed session read/init failed, do not write back to DB | |
string | $lasthash = null |
$lasthash hash of the session data content | |
stdClass | $recordid = null |
$record session record | |
Database based session handler.
core\session\database::handler_close | ( | ) |
Close session handler.
{
bool | success |
core\session\database::handler_destroy | ( | $sid | ) |
Destroy session handler.
{
string | $sid |
bool | success |
core\session\database::handler_gc | ( | $ignored_maxlifetime | ) |
GC session handler.
{
int | $ignored_maxlifetime | moodle uses special timeout rules |
bool | success |
core\session\database::handler_open | ( | $save_path, | |
$session_name | |||
) |
Open session handler.
{
string | $save_path | |
string | $session_name |
bool | success |
core\session\database::handler_read | ( | $sid | ) |
Read session handler.
{
string | $sid |
string |
core\session\database::handler_write | ( | $sid, | |
$session_data | |||
) |
Write session handler.
{
NOTE: Do not write to output or throw any exceptions! Hopefully the next page is going to display nice error or it recovers...
string | $sid | |
string | $session_data |
bool | success |
core\session\database::kill_session | ( | $sid | ) |
Kill one session, the session record is removed afterwards.
string | $sid |
Reimplemented from core\session\handler.
core\session\database::session_exists | ( | $sid | ) |
Check the backend contains data for this session id.
Note: this is intended to be called from manager::session_exists() only.
string | $sid |
bool | true if session found. |
Reimplemented from core\session\handler.
|
inherited |
Start the session.
bool | success |
Reimplemented in core\session\redis, and core\session\memcached.