public function getEncryptedCookie($name, $deleteIfInvalid = true)
    {
        $value = \Slim\Http\Util::decodeSecureCookie(
            $this->request->cookies($name),
            $this->config('cookies.secret_key'),
            $this->config('cookies.cipher'),
            $this->config('cookies.cipher_mode')
        );
        if ($value === false && $deleteIfInvalid) {
            $this->deleteCookie($name);
        }

        return $value;
    }