sessionValues[$key] = $value; } public function get($key, $defaultValue = null) { return isset($this->sessionValues[$key]) ? $this->sessionValues[$key] : $defaultValue; } public function getAll() { return $this->sessionValues; } public function setAll(array $values, $overwrite = false) { if ($overwrite) { $this->clear(); } foreach ($values as $key => $value) { if (isset($this->sessionValues[$key]) && !$overwrite) { continue; } $this->sessionValues[$key] = $value; } } public function clear() { $this->sessionValues = array(); } }