Adding remove key functionnality to SessionService
This commit is contained in:
parent
42283dade2
commit
8085dd3c3e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user