ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSessionDBHandler.php
Go to the documentation of this file.
1<?php
2
19declare(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 {
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 {
90 }
91
96 public function gc(int $max_lifetime): int | false
97 {
99 }
100}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
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.
gc(int $max_lifetime)
Removes sessions that weren't updated for more than gc_maxlifetime seconds.
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.
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:30