diff options
Diffstat (limited to 'lib/private/session/memory.php')
-rw-r--r-- | lib/private/session/memory.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/session/memory.php b/lib/private/session/memory.php index 1b9ac452575..1562c2ce037 100644 --- a/lib/private/session/memory.php +++ b/lib/private/session/memory.php @@ -28,6 +28,7 @@ class Memory extends Session { * @param integer $value */ public function set($key, $value) { + $this->validateSession(); $this->data[$key] = $value; } @@ -54,10 +55,17 @@ class Memory extends Session { * @param string $key */ public function remove($key) { + $this->validateSession(); unset($this->data[$key]); } public function clear() { $this->data = array(); } + + private function validateSession() { + if ($this->sessionClosed) { + throw new \Exception('Session has been closed - no further changes to the session as allowed'); + } + } } |