ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSessionDBHandler Class Reference
+ Inheritance diagram for ilSessionDBHandler:
+ Collaboration diagram for ilSessionDBHandler:

Public Member Functions

 setSaveHandler ()
 Registers the session save handler session.save_handler must be 'user'. More...
 
 open ($path, $name)
 Opens session, normally a db connection would be opened here, but we use the standard ilias db connection, so nothing must be done here. More...
 
 close ()
 close session More...
 
 read ($id)
 Reads data of the session identified by $session_id and returns it as a serialised string. More...
 
 write ($id, $data)
 Writes serialized session data to the database. More...
 
 destroy ($id)
 Destroys session. More...
 
 gc (int $max_lifetime)
 Removes sessions that weren't updated for more than gc_maxlifetime seconds. More...
 

Detailed Description

Definition at line 21 of file class.ilSessionDBHandler.php.

Member Function Documentation

◆ close()

ilSessionDBHandler::close ( )

close session

for a db nothing has to be done here

Definition at line 55 of file class.ilSessionDBHandler.php.

55 : bool
56 {
57 return true;
58 }

◆ destroy()

ilSessionDBHandler::destroy (   $id)

Destroys session.

Parameters
string$idsession id

Definition at line 87 of file class.ilSessionDBHandler.php.

87 : bool
88 {
90 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.

References $id, and ilSession\_destroy().

+ Here is the call graph for this function:

◆ gc()

ilSessionDBHandler::gc ( int  $max_lifetime)

Removes sessions that weren't updated for more than gc_maxlifetime seconds.

Parameters
int$max_lifetimeSessions that have not updated for the last max_lifetime seconds will be removed.

Definition at line 96 of file class.ilSessionDBHandler.php.

96 : int | false
97 {
99 }
static _destroyExpiredSessions()
Destroy expired sessions.

References ilSession\_destroyExpiredSessions().

+ Here is the call graph for this function:

◆ open()

ilSessionDBHandler::open (   $path,
  $name 
)

Opens session, normally a db connection would be opened here, but we use the standard ilias db connection, so nothing must be done here.

Parameters
string$path
string$namesession name [PHPSESSID]

Definition at line 45 of file class.ilSessionDBHandler.php.

45 : bool
46 {
47 return true;
48 }

◆ read()

ilSessionDBHandler::read (   $id)

Reads data of the session identified by $session_id and returns it as a serialised string.

If there is no session with this ID an empty string is returned

Parameters
string$id

Definition at line 66 of file class.ilSessionDBHandler.php.

66 : string
67 {
69 }
static _getData(string $a_session_id)
Get session data from table.

References $id, and ilSession\_getData().

+ Here is the call graph for this function:

◆ setSaveHandler()

ilSessionDBHandler::setSaveHandler ( )

Registers the session save handler session.save_handler must be 'user'.

Definition at line 27 of file class.ilSessionDBHandler.php.

27 : 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 }

◆ write()

ilSessionDBHandler::write (   $id,
  $data 
)

Writes serialized session data to the database.

Parameters
string$idsession id
string$datasession data

Definition at line 76 of file class.ilSessionDBHandler.php.

76 : bool
77 {
78 chdir(IL_INITIAL_WD);
79
80 return ilSession::_writeData($id, $data);
81 }

References $data, and $id.


The documentation for this class was generated from the following file: