public function close()
    {
        if($this->id == null) {
            throw new InternalException('Session not loaded');
        }

        if(!$this->cli) {
            session_write_close();
        }

        $this->id = null;
    }