Adding remove key functionnality to SessionService

This commit is contained in:
Antonin 2016-04-29 19:38:00 +02:00
parent 42283dade2
commit 8085dd3c3e

View File

@ -44,6 +44,19 @@ class SessionService {
$_SESSION[$section][$key] = $value;
}
/**
* Remove a session value
*
* @param $section
* @param $key
*/
public function remove($section, $key) {
assert(!empty($key));
assert(!empty($section));
unset($_SESSION[$section][$key]);
}
private function initSectionIfNeeded($section) {
if (!isset($_SESSION[$section])) {
$_SESSION[$section] = array();