summaryrefslogtreecommitdiffstats
path: root/lib/private/session/memory.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/session/memory.php')
-rw-r--r--lib/private/session/memory.php8
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');
+ }
+ }
}