ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

@module inc.db_session_handler.php @modulegroup 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 58 of file class.ilSessionDBHandler.php.

59 {
60 return true;
61 }

◆ destroy()

ilSessionDBHandler::destroy (   $session_id)

destroy session

Parameters
integer$session_idsession id

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

98 {
99 return ilSession::_destroy($session_id);
100 }
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.

References ilSession\_destroy().

+ 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 107 of file class.ilSessionDBHandler.php.

108 {
110 }
static _destroyExpiredSessions()
Destroy expired sessions.

References ilSession\_destroyExpiredSessions().

+ Here is the call graph for this function:

◆ open()

ilSessionDBHandler::open (   $save_path,
  $name 
)

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

49 {
50 return true;
51 }

◆ read()

ilSessionDBHandler::read (   $session_id)

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

71 {
72 return ilSession::_getData($session_id);
73 }
static _getData($a_session_id)
Get session data from table.

References ilSession\_getData().

+ 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 (ini_get("session.save_handler") == "user")
24 {
25 session_set_save_handler(
26 array($this, "open"),
27 array($this, "close"),
28 array($this, "read"),
29 array($this, "write"),
30 array($this, "destroy"),
31 array($this, "gc"));
32
33 return true;
34 }
35
36 return false;
37 }

◆ write()

ilSessionDBHandler::write (   $session_id,
  $data 
)

Writes serialized session data to the database.

Parameters
integer$session_idsession id
string$datasession data

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

82 {
83 $cwd = getcwd();
84 chdir(IL_INITIAL_WD);
85 include_once("./Services/Authentication/classes/class.ilSession.php");
86 $r = ilSession::_writeData($session_id, $data);
87 // see bug http://www.ilias.de/mantis/view.php?id=18000
88 //chdir($cwd);
89 return $r;
90 }
static _writeData($a_session_id, $a_data)
Write session data.
$data
$r
Definition: example_031.php:79
const IL_INITIAL_WD
Definition: error.php:5

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

+ Here is the call graph for this function:

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