isOpen && $this->isWritten) { throw new \Exception("Session write after close"); } $this->isOpen = true; } public function read($keepOpen = false) { $this->open(); if (!$keepOpen) { $this->close(); } } public function write($keepOpen = false) { $this->open(); if (!$keepOpen) { $this->close(); } } public function close() { $this->isOpen = false; $this->isWritten = true; } public function purge() { } }