Sets a cookie.
@param name the name
@param value the value
@param req HTTP request
@param res HTTP response
@param httpOnly HTTP only flag
182498
public static void setStateParam(String name, String value, HttpServletRequest req,
			HttpServletResponse res, boolean httpOnly) {
		setRawCookie(name, value, req, res, httpOnly, -1);
	}
952010
def create_cookie(name, value, **kwargs):
    
    result = {
        'version': 0,
        'name': name,
        'value': value,
        'port': None,
        'domain': '',
        'path': '/',
        'secure': False,
        'expires': None,
        'discard': True,
        'comment': None,
        'comment_url': None,
        'rest': {'HttpOnly': None},
        'rfc2109': False,
    }

    badargs = set(kwargs) - set(result)
    if badargs:
        err = 'create_cookie() got unexpected keyword arguments: %s'
        raise TypeError(err % list(badargs))

    result.update(kwargs)
    result['port_specified'] = bool(result['port'])
    result['domain_specified'] = bool(result['domain'])
    result['domain_initial_dot'] = result['domain'].startswith('.')
    result['path_specified'] = bool(result['path'])

    return cookielib.Cookie(**result)
31310
public function cookie($name, $value, $expires = 0, $path = '', $domain = '', $secure = false, $httpOnly = false)
    {
        $cookie = new Cookie(
            $name,
            $value,
            $expires
        );

        return $cookie
            ->setPath($path)
            ->setDomain($domain)
            ->setIsSecure($secure)
            ->setIsHttpOnly($httpOnly)
            ->commit();
    }
336193
public CrawlerPack addCookie(String name, String value){
        if( null == name ) {
            log.warn("addCookie: Cookie name null.");
            return this;
        }

        cookies.add( new Cookie("", name, value) );

        return this;
    }
1374889
public void set(String name, String value) {
		HttpHeader header = get(name);
		if(header == null) {
			add(name,value);
		} else {
			header.setValue(value);
		}
	}
1207104
function (name,val) {
    var cookieVal = $.cookie(this.cookieName);
    cookieVal = ((cookieVal === null) || (cookieVal === "")) ? name+"~"+val : cookieVal+"|"+name+"~"+val;
    $.cookie(this.cookieName,cookieVal);
  }
468423
public void sendPermanentCookie(String name, String value) {
        Cookie cookie = new Cookie(name, value);
        cookie.setMaxAge(60*60*24*365*20);
        RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(cookie));
    }
486498
public HttpResponse withCookie(String name, String value) {
        this.cookies.withEntry(name, value);
        return this;
    }
200460
public static void setCookie(HttpServletResponse response, String name,
                                 String value, String domain, int maxAge) {
        if (value == null) {
            value = "";
        }
        Cookie cookie = new Cookie(name, value);
        cookie.setMaxAge(maxAge);
        if (domain != null && !"".equals(domain)) {
            cookie.setDomain(domain);
        }
        cookie.setPath("/");
        response.addCookie(cookie);
    }
1165664
def cookie_set(self, name, value):
		
		if not self.headers_active:
			raise RuntimeError('headers have already been ended')
		cookie = "{0}={1}; Path=/; HttpOnly".format(name, value)
		self.send_header('Set-Cookie', cookie)
1259536
protected function setCookie($name, $value = null)
    {
        if ($value !== null) {
            $this->cookie[$name] = $value;
        } elseif (isset($this->cookie[$name])) {
            unset($this->cookie[$name]);
        }
    }
48074
public static void addCookie(HttpServletRequest request, HttpServletResponse response, String name,
      String value, int age) {
    String contextPath = request.getContextPath();
    if (!contextPath.endsWith("/")) {
      contextPath += "/";
    }
    addCookie(request, response, name, value, contextPath, age);
  }
948012
public void addCookie(String name, String value, HttpServletResponse response) {
        Cookie cookie = new Cookie(name, value);
        cookie.setHttpOnly(httpOnly);
        cookie.setSecure(secure);
        if (StringUtils.isNotEmpty(domain)) {
            cookie.setDomain(domain);
        }
        if (StringUtils.isNotEmpty(path)) {
            cookie.setPath(path);
        }
        if (maxAge != null) {
            cookie.setMaxAge(maxAge);
        }

        response.addCookie(cookie);

        logger.debug(LOG_KEY_ADDED_COOKIE, name);
    }
1295632
public static Cookie getCookie (HttpServletRequest req, String name)
    {
        Cookie[] cookies = req.getCookies();
        if (cookies != null) {
            for (int ii=0, nn=cookies.length; ii < nn; ii++) {
                if (cookies[ii].getName().equals(name)) {
                    return cookies[ii];
                }
            }
        }

        return null; // not found
    }
1351214
public function addCookie($name, $value, $httpOnly = false)
    {
        Mage::getSingleton('ecomdev_varnish/cookie')->set($name, $value, $httpOnly);
        return $this;
    }
218392
function setcookie($name, $value = null, $expire = null, $path = '/', $domain = null, $secure = null, $httponly = null)
    {
        if ($value == null)
        {
            $value = 'deleted';
        }
        $cookie = "$name=$value";
        if ($expire)
        {
            $cookie .= "; expires=" . date("D, d-M-Y H:i:s T", $expire);
        }
        if ($path)
        {
            $cookie .= "; path=$path";
        }
        if ($secure)
        {
            $cookie .= "; secure";
        }
        if ($domain)
        {
            $cookie .= "; domain=$domain";
        }
        if ($httponly)
        {
            $cookie .= '; httponly';
        }
        $this->cookie[] = $cookie;
    }
335279
public function setCookie(
        $name,
        $value,
        $expires = null,
        $path = null,
        $domain = null,
        $secure = null,
        $httpOnly = null
    ) {
        $expires  = is_null($expires) ? $this->vitex->getConfig('cookies.lifetime') : $expires;
        $path     = is_null($path) ? $this->vitex->getConfig('cookies.path') : $path;
        $domain   = is_null($domain) ? $this->vitex->getConfig('cookies.domain') : $domain;
        $secure   = is_null($secure) ? $this->vitex->getConfig('cookies.secure') : $secure;
        $httpOnly = is_null($httpOnly) ? $this->vitex->getConfig('cookies.httponly') : $httpOnly;
        if (!is_numeric($expires)) {
            $expires = strtotime($expires);
        }
        $secret_key = $this->vitex->getConfig('cookies.secret_key');
        $encrypt    = $this->vitex->getConfig('cookies.encrypt');
        if ($encrypt) {
            $value = Utils::encrypt($value, $secret_key);
        }
        setcookie($name, $value, $expires, $path, $domain, $secure, $httpOnly);
    }