ILIAS
release_4-3 Revision
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilSessionDBHandler.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once(
"./Services/Authentication/classes/class.ilSession.php"
);
6
14
class
ilSessionDBHandler
15
{
16
/*
17
* register callback functions
18
* session.save_handler must be 'user' or safe mode off to succeed
19
*/
20
public
function
setSaveHandler
()
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
}
38
39
/*
40
* open session, normally a db connection would be opened here, but
41
* we use the standard ilias db connection, so nothing must be done here
42
*
43
* @param string $save_pathDSN information about how to access the database, format:
44
* dbtype(dbsyntax)://username:password@protocol+hostspec/database
45
* eg. mysql://phpsessmgr:topsecret@db.example.com/sessiondb
46
* @param string $name session name [PHPSESSID]
47
*/
48
public
function
open
($save_path, $name)
49
{
50
return
true
;
51
}
52
58
public
function
close
()
59
{
60
return
true
;
61
}
62
63
/*
64
* Reads data of the session identified by $session_id and returns it as a
65
* serialised string. If there is no session with this ID an empty string is
66
* returned
67
*
68
* @param integer $session_id session id
69
*/
70
public
function
read
($session_id)
71
{
72
return
ilSession::_getData
($session_id);
73
}
74
81
public
function
write
($session_id,
$data
)
82
{
83
return
ilSession::_writeData
($session_id,
$data
);
84
}
85
91
public
function
destroy
($session_id)
92
{
93
return
ilSession::_destroy
($session_id);
94
}
95
101
public
function
gc
($gc_maxlifetime)
102
{
103
return
ilSession::_destroyExpiredSessions
();
104
}
105
}
106
107
// needs to be done to assure that $ilDB exists,
108
// when db_session_write is called
109
register_shutdown_function(
"session_write_close"
);
110
111
?>
Services
Authentication
classes
class.ilSessionDBHandler.php
Generated on Sat Apr 30 2016 19:00:51 for ILIAS by
1.8.1.2 (using
Doxyfile
)