| 2125 |
static $currentSession; |
static $currentSession; |
| 2126 |
if (!is_object($currentSession)) { |
if (!is_object($currentSession)) { |
| 2127 |
$currentSession = new mosSession(); |
$currentSession = new mosSession(); |
| 2128 |
$currentSession->purge(intval(mamboCore::get('mosConfig_lifetime'))); |
mosSession::purge(); |
| 2129 |
$sessionCookieName = md5('site'.mamboCore::get('mosConfig_live_site')); |
$sessionCookieName = md5('site'.mamboCore::get('mosConfig_live_site')); |
| 2130 |
$sessioncookie = mosGetParam($_COOKIE, $sessionCookieName, null); |
$sessioncookie = mosGetParam($_COOKIE, $sessionCookieName, null); |
| 2131 |
$usercookie = mosGetParam($_COOKIE, 'usercookie', null); |
$usercookie = mosGetParam($_COOKIE, 'usercookie', null); |
| 2198 |
return $this->_session_cookie; |
return $this->_session_cookie; |
| 2199 |
} |
} |
| 2200 |
|
|
| 2201 |
function purge( $inc=1800 ) { |
function purge () { |
| 2202 |
$past = time() - $inc; |
$past = time() - intval(mamboCore::get('mosConfig_lifetime')); |
| 2203 |
$query = "DELETE FROM $this->_tbl" |
$database = mamboDatabase::getInstance(); |
| 2204 |
. "\nWHERE (time < $past)"; |
$result = $database->setQuery("DELETE FROM #__session WHERE (time < $past) AND guest >= 0"); |
| 2205 |
$this->_db->setQuery($query); |
if ($result) return $result; |
| 2206 |
|
$past = time() - 3600; |
| 2207 |
return $this->_db->query(); |
$database->setQuery("DELETE FROM #__session WHERE (time < $past) AND guest < 0"); |
| 2208 |
|
return $database->query(); |
| 2209 |
} |
} |
| 2210 |
|
|
| 2211 |
} |
} |
| 2212 |
|
|
| 2213 |
/** |
/** |