ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSessionDBHandler Class Reference

Database Session Handling. More...

+ Collaboration diagram for ilSessionDBHandler:

Public Member Functions

 setSaveHandler ()
 
 open ($save_path, $name)
 
 close ()
 close session More...
 
 read ($session_id)
 
 write ($session_id, $data)
 Writes serialized session data to the database. More...
 
 destroy ($session_id)
 destroy session More...
 
 gc ($gc_maxlifetime)
 removes sessions that weren't updated for more than gc_maxlifetime seconds More...
 

Detailed Description

Database Session Handling.

inc.db_session_handler.php iliascore

Version
Id
inc.db_session_handler.php 18894 2009-02-06 15:24:04Z akill

Definition at line 14 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 62 of file class.ilSessionDBHandler.php.

63  {
64  return true;
65  }

◆ destroy()

ilSessionDBHandler::destroy (   $session_id)

destroy session

Parameters
integer$session_idsession id

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

References ilSession\_destroy().

102  {
103  return ilSession::_destroy($session_id);
104  }
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.
+ Here is the call graph for this function:

◆ gc()

ilSessionDBHandler::gc (   $gc_maxlifetime)

removes sessions that weren't updated for more than gc_maxlifetime seconds

Parameters
integer$gc_maxlifetimemax lifetime in seconds

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

References ilSession\_destroyExpiredSessions().

112  {
114  }
static _destroyExpiredSessions()
Destroy expired sessions.
+ Here is the call graph for this function:

◆ open()

ilSessionDBHandler::open (   $save_path,
  $name 
)

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

53  {
54  return true;
55  }

◆ read()

ilSessionDBHandler::read (   $session_id)

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

References ilSession\_getData().

75  {
76  return ilSession::_getData($session_id);
77  }
static _getData($a_session_id)
Get session data from table.
+ Here is the call graph for this function:

◆ setSaveHandler()

ilSessionDBHandler::setSaveHandler ( )

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

21  {
22  // register save handler functions
23  if (session_status() === PHP_SESSION_ACTIVE) {
24  return true;
25  }
26 
27  if (ini_get("session.save_handler") == "user" || version_compare(PHP_VERSION, '7.2.0', '>=')) {
28  session_set_save_handler(
29  array($this, "open"),
30  array($this, "close"),
31  array($this, "read"),
32  array($this, "write"),
33  array($this, "destroy"),
34  array($this, "gc")
35  );
36 
37  return true;
38  }
39 
40  return false;
41  }

◆ write()

ilSessionDBHandler::write (   $session_id,
  $data 
)

Writes serialized session data to the database.

Parameters
integer$session_idsession id
string$datasession data

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

References $data, $r, ilSession\_writeData(), and IL_INITIAL_WD.

86  {
87  $cwd = getcwd();
88  chdir(IL_INITIAL_WD);
89  include_once("./Services/Authentication/classes/class.ilSession.php");
90  $r = ilSession::_writeData($session_id, $data);
91  // see bug http://www.ilias.de/mantis/view.php?id=18000
92  //chdir($cwd);
93  return $r;
94  }
$r
Definition: example_031.php:79
const IL_INITIAL_WD
Definition: error.php:4
static _writeData($a_session_id, $a_data)
Write session data.
$data
Definition: bench.php:6
+ Here is the call graph for this function:

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