public function init($gp, $settings) { parent::init($gp, $settings); if (is_array($_SESSION['formhandler'])) { foreach ($_SESSION['formhandler'] as $hashedID => $sesData) { $threshold = $this->getOldSessionThreshold(); if (!$this->gp['submitted'] && $this->globals->getFormValuesPrefix() === $sesData['formValuesPrefix'] && $sesData['creationTstamp'] < $threshold) { unset($_SESSION['formhandler'][$hashedID]); } } } else { $_SESSION['formhandler'] = []; } }
public function init($gp, $settings) { parent::init($gp, $settings); $threshold = $this->getOldSessionThreshold(); $data = $GLOBALS['TSFE']->fe_user->getKey('ses', 'formhandler'); if (is_array($data)) { foreach ($data as $hashedID => $sesData) { if (!$this->gp['submitted'] && $this->globals->getFormValuesPrefix() === $sesData['formValuesPrefix'] && $sesData['creationTstamp'] < $threshold) { unset($data[$hashedID]); } } } else { $data = array(); } $GLOBALS['TSFE']->fe_user->setKey('ses', 'formhandler', $data); $GLOBALS['TSFE']->fe_user->storeSessionData(); }