setCookie = (useRemainingExpirationTime) => {
    const { hostname, protocol } = location;
    const { name, path, domain, sameSite, useLocalStorage, secure } = globalObj._config.cookie;

    const expiresAfterMs = useRemainingExpirationTime
        ? getRemainingExpirationTimeMS()
        : getExpiresAfterDaysValue()*86400000;

    /**
     * Expiration date
     */
    const date = new Date();
    date.setTime(date.getTime() + expiresAfterMs);

    /**
     * Store the expiration date in the cookie (in case localstorage is used)
     */

    globalObj._state._savedCookieContent.expirationTime = date.getTime();

    const value = JSON.stringify(globalObj._state._savedCookieContent);

    /**
     * Encode value (RFC compliant)
     */
    const cookieValue = encodeURIComponent(value);

    let cookieStr = name + '='
        + cookieValue
        + (expiresAfterMs !== 0 ? '; expires=' + date.toUTCString() : '')
        + '; Path=' + path
        + '; SameSite=' + sameSite;

    /**
     * Set "domain" only if hostname contains a dot (e.g domain.com)
     * to ensure that cookie works with 'localhost'
     */
    if (elContains(hostname, '.'))
        cookieStr += '; Domain=' + domain;

    if (secure && protocol === 'https:')
        cookieStr += '; Secure';

    useLocalStorage
        ? localStorageManager._setItem(name, value)
        : document.cookie = cookieStr;

    debug('CookieConsent [SET_COOKIE]: ' + name + ':', globalObj._state._savedCookieContent);
}
Set plugin's cookie
@param {boolean} [useRemainingExpirationTime]