public function destroy()
    {
        if ($this->getIsActive()) {
            $sessionId = $this->getId();
            return $this->close(true)
                ->otherwise(function() { return true; })
                ->then(function() use ($sessionId) {
                    $this->setId($sessionId);
                    return $this->open();
                });
        }
        return Reaction\Promise\resolve(true);
    }