14 $this->dbaccess = $dbaccess;
20 $err =
$query->exec_query(
"SELECT val FROM paramv WHERE name = 'CORE_SESSIONMAXAGE'");
22 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"exec_query returned with error: " .
$err);
25 if (
$query->numrows() <= 0) {
26 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " .
"exec_query returned an empty result set");
29 $res =
$query->fetch_array(0);
30 if (is_numeric($res[
'val'])) {
31 return $res[
'val'] .
" seconds";
39 if ($session_maxage ===
false) {
42 if (preg_match(
'/^(\d+)\s+(\w+)/i', $session_maxage, $m)) {
44 $unit = strtolower($m[2]);
45 switch (substr($unit, 0, 1)) {
47 $maxage = $maxage * 364 * 24 * 60 * 60;
51 if (substr($unit, 0, 2) ==
'mo') {
52 $maxage = $maxage * 30 * 24 * 60 * 60;
56 $maxage = $maxage * 60;
61 $maxage = $maxage * 7 * 24 * 60 * 60;
65 $maxage = $maxage * 24 * 60 * 60;
69 $maxage = $maxage * 60 * 60;
85 include_once (
'WHAT/Lib.Prefix.php');
90 if ($session_maxage ===
false) {
91 $err = sprintf(
"Malformed CORE_SESSIONMAXAGE");
94 $maxage = time() - $session_maxage;
96 $sessionDir = sprintf(
"%s/var/session", $pubdir);
97 $dir = opendir($sessionDir);
99 $err = sprintf(
"Error opening directory '%s'.", $sessionDir);
105 if (preg_match(
"/^sess_(.+)$/",
$file, $m)) {
107 $sess_file = sprintf(
"%s/%s", $sessionDir,
$file);
108 $stat = @stat($sess_file);
109 if ($stat !==
false && $stat[
'mtime'] < $maxage) {
deleteExpiredSessionFiles()
getSessionMaxAgeSeconds($default="1 week")
if(($docid!==0)&&(!is_numeric($docid))) $query
if($file) if($subject==""&&$file) if($subject=="") $err