+2009-07-20 Oliver Hader <oliver@typo3.org>
+
+ * Added feature #11509: Move automatic session data garbage collection to separate method
+
2009-07-19 Oliver Hader <oliver@typo3.org>
* Fixed bug #6875: IRRE - Sorting of child records is inverted on moving parent record to different page (thanks to Nabil Saleh)
}
$GLOBALS['TYPO3_DB']->sql_free_result($dbres);
}
- // delete old data:
- if ((rand()%100) <= 1) { // a possibility of 1 % for garbage collection.
- $timeoutTimeStamp = intval($GLOBALS['EXEC_TIME'] - $this->sessionDataLifetime);
- $GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < ' . $timeoutTimeStamp);
- }
}
/**
);
}
+ /**
+ * Executes the garbage collection of session data and session.
+ * The lifetime of session data is defined by $TYPO3_CONF_VARS['FE']['sessionDataLifetime'].
+ *
+ * @return void
+ */
+ public function gc() {
+ $timeoutTimeStamp = intval($GLOBALS['EXEC_TIME'] - $this->sessionDataLifetime);
+ $GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < ' . $timeoutTimeStamp);
+
+ parent::gc();
+ }
+
/**
* Returns session data for the fe_user; Either persistent data following the fe_users uid/profile (requires login) or current-session based (not available when browse is closed, but does not require login)
*