sessionService: use a generic removeAll function to unset FORM data
Instead of manually removing entries in the SESSION object, let the SessionService do the work in creating poll controllers.
This commit is contained in:
parent
5d74a5600d
commit
f0b38fdb42
|
@ -55,9 +55,20 @@ class SessionService {
|
|||
unset($_SESSION[$section][$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a session section
|
||||
*
|
||||
* @param $section
|
||||
*/
|
||||
public function removeAll($section) {
|
||||
assert(!empty($section));
|
||||
|
||||
unset($_SESSION[$section]);
|
||||
}
|
||||
|
||||
private function initSectionIfNeeded($section) {
|
||||
if (!isset($_SESSION[$section])) {
|
||||
$_SESSION[$section] = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ switch ($step) {
|
|||
}
|
||||
|
||||
// Clean Form data in $_SESSION
|
||||
unset($_SESSION['form']);
|
||||
$sessionService->removeAll('form');
|
||||
|
||||
// Delete old polls
|
||||
$purgeService->repeatedCleanings();
|
||||
|
|
|
@ -230,7 +230,7 @@ switch ($step) {
|
|||
}
|
||||
|
||||
// Clean Form data in $_SESSION
|
||||
unset($_SESSION['form']);
|
||||
$sessionService->removeAll('form');
|
||||
|
||||
$purgeService->repeatedCleanings();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user