Index: branches/RC/core/kernel/session/session.php =================================================================== diff -u -r10111 -r10294 --- branches/RC/core/kernel/session/session.php (.../session.php) (revision 10111) +++ branches/RC/core/kernel/session/session.php (.../session.php) (revision 10294) @@ -236,7 +236,18 @@ { $expired_sids = $this->GetExpiredSIDs(); if ($expired_sids) { - $where_clause=' WHERE '.$this->IDField.' IN ("'.implode('","',$expired_sids).'")'; + $sessionlog_table = $this->Application->getUnitOption('session-log', 'TableName'); + $session_log_sql = + ' UPDATE '.$sessionlog_table.' + SET Status = 2, SessionEnd = + ( SELECT '.$this->TimestampField.' - '.$this->SessionTimeout.' + FROM '.$this->TableName.' + WHERE '.$this->IDField.' = '.$sessionlog_table.'.SessionId + ) + WHERE Status = 0 AND SessionId IN ('.join(',', $expired_sids).')'; + $this->Conn->Query($session_log_sql); + + $where_clause = ' WHERE '.$this->IDField.' IN ("'.implode('","',$expired_sids).'")'; $sql = 'DELETE FROM '.$this->SessionDataTable.$where_clause; $this->Conn->Query($sql); @@ -245,7 +256,7 @@ // delete debugger ouputs left of expired sessions foreach ($expired_sids as $expired_sid) { - $debug_file = KERNEL_PATH.'/../cache/debug_@'.$expired_sid.'@.txt'; + $debug_file = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel').'/cache/debug_@'.$expired_sid.'@.txt'; if (file_exists($debug_file)) { @unlink($debug_file); }