Sets response cookie

@param cookieName  cookie name
@param cookieValue cookie value
@return response builder
427652
public HttpClientResponseBuilder withCookie(String cookieName, String cookieValue) {
        Action lastAction = newRule.getLastAction();
        CookieAction cookieAction = new CookieAction(lastAction, cookieName, cookieValue);
        newRule.overrideLastAction(cookieAction);
        return this;
    }
1018204
@Override
  public final String getCookieValue(final String pName) {
    if (this.httpReq.getCookies() == null) {
      return null;
    }
    for (Cookie co : this.httpReq.getCookies()) {
      if (co.getName().equals(pName)) {
        return co.getValue();
      }
    }
    return null;
  }
1069910
public static void setCookieValue(HttpServletResponse response, String key, String value)
	{
		setCookieValue(response, key, value, "/", -1);
	}
620415
public static String getCookieValue(Cookie[] cookies, String name) {

        for (int i = 0; (cookies != null) && (i < cookies.length); i++) {
            if (name.equalsIgnoreCase(cookies[i].getName())) {
                return cookies[i].getValue();
            }
        }
        return null;
    }
1022853
function setCookie(cookieName, cookieValue, expDays) {
  var d = new Date();
  d.setTime(d.getTime() + expDays * 24 * 60 * 60 * 1000);
  var expires = 'expires=' + d.toUTCString();
  try {
    document.cookie = cookieName + '=' + cookieValue + '; Path=/; ' + expires;
  } catch (e) {
    _logger2.default.warn({
      description: 'Cookie cannot be set because browser is not capable.',
      cookieName: cookieName, func: 'setCookie', obj: 'cookiesUtil'
    });
  }
}
279590
@Override
    public boolean set(HttpCookie cookie, byte[] attribValue) {
        try {
            if (null != attribValue && 0 < attribValue.length) {
                cookie.setMaxAge(GenericUtils.asIntValue(attribValue));
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Cookie max-age set to " + cookie.getMaxAge());
                }
            }
            return true;
        } catch (NumberFormatException e) {
            FFDCFilter.processException(e, getClass().getName(), "set", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Error in cookie max-age attribute: " + String.valueOf(attribValue));
            }
        }
        return false;
    }
371617
public void sendCookie(String name, String value) {
        context.addCookie(Cookie.builder(name, value).build());
    }
512864
public void setTokenValue(String tokenName, Cookie value) {
		if (value == null) {
			tokenValues.remove(tokenName);
		} else {
			tokenValues.put(tokenName, value);
		}
	}
1098941
public static void storeSessionDataInCookie(String key, String value, ServletResponse response)
	{
		Cookie cookie = new Cookie(key, value);
		cookie.setPath("/");
		cookie.setMaxAge(-1);//expire when browser closes
		((HttpServletResponse) response).addCookie(cookie);
	}
636390
protected function setCookieInResponse(Cookie $cookie)
    {
        $method = $cookie->isRaw() ? 'rawcookie' : 'cookie';

        $this->response->$method(
            $cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(),
            $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()
        );
    }
723901
@Nonnull
  public final UnifiedResponse addCookie (@Nonnull final Cookie aCookie)
  {
    ValueEnforcer.notNull (aCookie, "Cookie");

    final String sKey = aCookie.getName ();
    if (m_aCookies == null)
      m_aCookies = _createCookieMap ();
    else
    {
      if (m_bWarnOnDuplicateCookies && m_aCookies.containsKey (sKey))
        logWarn ("Overwriting cookie '" + sKey + "' with the new value '" + aCookie.getValue () + "'");
    }
    m_aCookies.put (sKey, aCookie);
    return this;
  }
1203919
public void sendCookie(String name, String value) {
        RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(new Cookie(name, value)));
    }
170691
public function putCookie(array $cookieValues): self
    {
        $cookieValue = '';
        foreach ($cookieValues as $key => $value) {
            $cookieValue .= $key . '=' . urlencode($value) . ';';
        }

        $this->put('Cookie', $cookieValue);
        return $this;
    }
947571
public static boolean addCookie(HttpServletResponse response, String name, String value) {
        return addCookie(new Cookie(name, value), response);
    }
1257467
public static String getCookieValue(HttpServletRequest request, String cookieName) {
    try {
      Cookie cookie = getCookie(request, cookieName);
      if (null == cookie) {
        return null;
      } else {
        return URLDecoder.decode(cookie.getValue(), "utf-8");
      }
    } catch (Exception e) {
      return null;
    }
  }
852733
public static Cookie getCookie(String name, Cookie[] cookies) {
        if (Checker.isNotEmpty(cookies)) {
            for (Cookie cookie : cookies) {
                if (name.equals(cookie.getName())) {
                    return cookie;
                }
            }
        }
        return null;
    }
1044708
public void addSetCookie(Cookie cookie)
    {
        String name=cookie.getName();
        String value=cookie.getValue();
        int version=cookie.getVersion();
        
        // Check arguments
        if (name==null || name.length()==0)
            throw new IllegalArgumentException("Bad cookie name");

        // Format value and params
        StringBuffer buf = new StringBuffer(128);
        String name_value_params=null;
        synchronized(buf)
        {
            buf.append(name);
            buf.append('=');
            if (value!=null && value.length()>0)
            {
                if (version==0)
                    URI.encodeString(buf,value,"\";, '");
                else
                    buf.append(QuotedStringTokenizer.quote(value,"\";, '"));
            }

            if (version>0)
            {
                buf.append(";Version=");
                buf.append(version);
                String comment=cookie.getComment();
                if (comment!=null && comment.length()>0)
                {
                    buf.append(";Comment=");
                    QuotedStringTokenizer.quote(buf,comment);
                }
            }
            String path=cookie.getPath();
            if (path!=null && path.length()>0)
            {
                buf.append(";Path=");
                buf.append(path);
            }
            String domain=cookie.getDomain();
            if (domain!=null && domain.length()>0)
            {
                buf.append(";Domain=");
                buf.append(domain.toLowerCase());// lowercase for IE
            }
            long maxAge = cookie.getMaxAge();
            if (maxAge>=0)
            {
                if (version==0)
                {
                    buf.append(";Expires=");
                    if (maxAge==0)
                        buf.append(__01Jan1970);
                    else
                        formatDate(buf,System.currentTimeMillis()+1000L*maxAge,true);
                }
                else
                {
                    buf.append (";Max-Age=");
                    buf.append (cookie.getMaxAge());
                }
            }
            else if (version>0)
            {
                buf.append (";Discard");
            }
            if (cookie.getSecure())
            {
                buf.append(";Secure");
            }
            if (cookie instanceof HttpOnlyCookie)
                buf.append(";HttpOnly");
            
            name_value_params = buf.toString();
        }
        put(__Expires,__01Jan1970);
        add(__SetCookie,name_value_params);
    }