public function setCookie($cookieName, $value = null, $expire = null) {
        if ($expire !== null) {
            $expire = time() + (60 * 60 * $expire);
        }

        if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) {
            return true;
        } else {
            return false;
        }
    }