ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSessionDBHandler.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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  {
71  return ilSession::_getData($id);
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  {
92  return ilSession::_destroy($id);
93  }
94 
99  public function gc($max_lifetime)
100  {
102  }
103 }
static _getData(string $a_session_id)
Get session data from table.
Database Session Handling.
setSaveHandler()
Registers the session save handler session.save_handler must be &#39;user&#39;.
static _destroyExpiredSessions()
Destroy expired sessions.
$path
Definition: ltiservices.php:32
if($format !==null) $name
Definition: metadata.php:247
read($id)
Reads data of the session identified by $session_id and returns it as a serialised string...
destroy($id)
Destroys session.
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.
gc($max_lifetime)
Removes sessions that weren&#39;t updated for more than gc_maxlifetime seconds.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
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.