ILIAS  release_8 Revision v8.24
class.ilSessionDBHandler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
30 public function setSaveHandler(): bool
31 {
32 if (session_status() === PHP_SESSION_ACTIVE) {
33 return true;
34 }
35
36 return session_set_save_handler(
37 $this,
38 true // Registers session_write_close() as a register_shutdown_function() function.
39 );
40 }
41
48 public function open($path, $name): bool
49 {
50 return true;
51 }
52
58 public function close(): bool
59 {
60 return true;
61 }
62
69 public function read($id): string
70 {
72 }
73
79 public function write($id, $data): bool
80 {
81 chdir(IL_INITIAL_WD);
82
83 return ilSession::_writeData($id, $data);
84 }
85
90 public function destroy($id): bool
91 {
93 }
94
99 public function gc($max_lifetime)
100 {
102 }
103}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Database Session Handling.
setSaveHandler()
Registers the session save handler session.save_handler must be 'user'.
read($id)
Reads data of the session identified by $session_id and returns it as a serialised string.
open($path, $name)
Opens session, normally a db connection would be opened here, but we use the standard ilias db connec...
write($id, $data)
Writes serialized session data to the database.
destroy($id)
Destroys session.
gc($max_lifetime)
Removes sessions that weren't updated for more than gc_maxlifetime seconds.
static _destroyExpiredSessions()
Destroy expired sessions.
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.
static _getData(string $a_session_id)
Get session data from table.
$path
Definition: ltiservices.php:32
if($format !==null) $name
Definition: metadata.php:247