ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
class.ilSessionDBHandler.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
27  public function setSaveHandler(): bool
28  {
29  if (session_status() === PHP_SESSION_ACTIVE) {
30  return true;
31  }
32 
33  return session_set_save_handler(
34  $this,
35  true // Registers session_write_close() as a register_shutdown_function() function.
36  );
37  }
38 
45  public function open($path, $name): bool
46  {
47  return true;
48  }
49 
55  public function close(): bool
56  {
57  return true;
58  }
59 
66  public function read($id): string
67  {
68  return ilSession::_getData($id);
69  }
70 
76  public function write($id, $data): bool
77  {
78  chdir(IL_INITIAL_WD);
79 
80  return ilSession::_writeData($id, $data);
81  }
82 
87  public function destroy($id): bool
88  {
89  return ilSession::_destroy($id);
90  }
91 
96  public function gc(int $max_lifetime): int | false
97  {
99  }
100 }
static _getData(string $a_session_id)
Get session data from table.
setSaveHandler()
Registers the session save handler session.save_handler must be &#39;user&#39;.
static _destroyExpiredSessions()
Destroy expired sessions.
$path
Definition: ltiservices.php:29
gc(int $max_lifetime)
Removes sessions that weren&#39;t updated for more than gc_maxlifetime seconds.
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.
$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.