23 $q =
"SELECT data FROM usr_session WHERE session_id = ".
24 $ilDB->quote($a_session_id,
"text");
25 $set = $ilDB->query($q);
26 $rec = $ilDB->fetchAssoc($set);
41 if (
$GLOBALS[
'WEB_ACCESS_WITHOUT_SESSION'])
49 if( $ilSetting->get(
'session_handling_type', 0) == 0)
52 $expires = time() + ini_get(
"session.gc_maxlifetime");
54 else if( $ilSetting->get(
'session_handling_type', 0) == 1)
71 if ($ilClientIniFile->readVariable(
"session",
"save_ip"))
73 $ilDB->update(
"usr_session", array(
74 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
75 "expires" => array(
"integer", $expires),
76 "data" => array(
"clob", $a_data),
77 "ctime" => array(
"integer", time()),
78 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"]),
79 "remote_addr" => array(
"text", $_SERVER[
"REMOTE_ADDR"])
81 "session_id" => array(
"text", $a_session_id)
86 $ilDB->update(
"usr_session", array(
87 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
88 "expires" => array(
"integer", $expires),
89 "data" => array(
"clob", $a_data),
90 "ctime" => array(
"integer", time()),
91 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"])
93 "session_id" => array(
"text", $a_session_id)
108 if ($ilClientIniFile->readVariable(
"session",
"save_ip"))
110 $ilDB->insert(
"usr_session", array(
111 "session_id" => array(
"text", $a_session_id),
112 "expires" => array(
"integer", $expires),
113 "data" => array(
"clob", $a_data),
114 "ctime" => array(
"integer", time()),
115 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
116 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"]),
117 "createtime" => array(
"integer", time()),
118 "remote_addr" => array(
"text", $_SERVER[
"REMOTE_ADDR"])
123 $ilDB->insert(
"usr_session", array(
124 "session_id" => array(
"text", $a_session_id),
125 "expires" => array(
"integer", $expires),
126 "data" => array(
"clob", $a_data),
127 "ctime" => array(
"integer", time()),
128 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
129 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"]),
130 "createtime" => array(
"integer", time())
155 $q =
"SELECT session_id FROM usr_session WHERE session_id = ".
156 $ilDB->quote($a_session_id,
"text");
157 $set = $ilDB->query($q);
158 if ($ilDB->fetchAssoc($set))
174 $q =
"DELETE FROM usr_session WHERE session_id = ".
175 $ilDB->quote($a_session_id,
"text");
176 $ilDB->manipulate($q);
190 $q =
"DELETE FROM usr_session WHERE user_id = ".
191 $ilDB->quote($a_user_id,
"integer");
192 $ilDB->manipulate($q);
204 $q =
"DELETE FROM usr_session WHERE expires < ".
205 $ilDB->quote(time(),
"integer");
206 $ilDB->manipulate($q);
222 $new_session = $a_session_id;
225 $new_session = md5($new_session);
226 $q =
"SELECT * FROM usr_session WHERE ".
227 "session_id = ".$ilDB->quote($new_session,
"text");
228 $res = $ilDB->query($q);
229 }
while($ilDB->fetchAssoc(
$res));
231 $query =
"SELECT * FROM usr_session ".
232 "WHERE session_id = ".$ilDB->quote($a_session_id,
"text");
235 while (
$row = $ilDB->fetchObject(
$res))
255 if (!$ilDB->tableColumnExists(
'usr_session',
'remote_addr'))
260 $query =
"SELECT DISTINCT user_id FROM usr_session"
261 .
" WHERE remote_addr = " . $ilDB->quote($a_ip,
"text")
262 .
" AND user_id > 0";
267 $users[] =
$row->user_id;