Adds all cookies by actually cloning them.
176236
public void addAllCloned(List<Cookie> cookies) {
		for(Cookie cookie : cookies) {
			Cookie clone = new Cookie(cookie);
			getStore().addCookie(clone.getHttpCookie());
		}
	}
457438
public void add(final URI uri, final HttpCookie cookie) {
        if(cookie.getMaxAge() == 0) {
            return;
        }

        if(cookie.getDomain() != null) {
            add(new DomainKey(cookie), cookie);
        }
        
        if(uri != null) {
            add(new UriKey(uri, cookie), cookie);
        }
    }
417553
public function addCookieObject(Cookie $cookie)
    {
        $name = $cookie->getName();
        $isNew = true;
        foreach ($this->cookies as $index => $value) {
            if ($value->getName() === $name) {
                $this->cookies[$index] = $cookie;
                $isNew = false;
            }
        }
        if ($isNew) {
            $index = array_search($name, $this->clearedCookies, true);
            if ($index !== false) {
                unset($this->clearedCookies[$index]);
                $this->clearedCookies = array_values($this->clearedCookies);
            }
            $this->cookies[] = $cookie;
        }

        return $this;
    }
670066
private function saveToCookies()
    {
        $value = serialize($this->items);
        setcookie($this->getName(), $value,
            time() + $this->settings['cookieLifeTime'] * 60 * 60 * 24, '/');
    }
474316
def cloneInto(self, newStore, avatars):
        
        la = LoginAccount(store=newStore,
                          password=self.password,
                          avatars=avatars,
                          disabled=self.disabled)
        for siteMethod in self.store.query(LoginMethod,
                                           LoginMethod.account == self):
            LoginMethod(store=newStore,
                        localpart=siteMethod.localpart,
                        domain=siteMethod.domain,
                        internal=siteMethod.internal,
                        protocol=siteMethod.protocol,
                        verified=siteMethod.verified,
                        account=la)
        return la
611011
def clone(self, **kwargs):
        

        grab = Grab(transport=self.transport_param)
        grab.config = self.dump_config()

        grab.doc = self.doc.copy()
        #grab.doc.grab = weakref.proxy(grab)

        for key in self.clonable_attributes:
            setattr(grab, key, getattr(self, key))
        grab.cookies = deepcopy(self.cookies)

        if kwargs:
            grab.setup(**kwargs)

        return grab
110582
def _clone_properties(self):
    """"""
    cls = self.__class__
    if self._properties is cls._properties:
      self._properties = dict(cls._properties)
807727
def add_cookie_header(self, request, referrer_host=None):
        '''
        '''
        new_request = convert_http_request(request, referrer_host)
        self._cookie_jar.add_cookie_header(new_request)

        request.fields.clear()

        for name, value in new_request.header_items():
            request.fields.add(name, value)
1199496
@Override
    public void addCookie(Cookie cookie) {
        super.addCookie(cookie);
        if(this.cookies == null) {
            this.cookies = new HashSet<Cookie>();
        }

        this.cookies.add(cookie);
    }
516135
def save_cookies(self, ignore_discard=True, ignore_expires=True):
        """"""
        if not isinstance(self.cookies, cookielib.FileCookieJar):
            m = 'Cookies must be a cookielib.FileCookieJar object to be saved.'
            raise APIError(m)
        self.cookies.save(ignore_discard=ignore_discard,
                          ignore_expires=ignore_expires)
318274
function fixedSaveCookies(res) {
    const cookies = res.headers['set-cookie'];

    if (cookies) {
        const fixedCookies = cookies.reduce(
            (cookies, cookie) => cookies.concat(cookie.split(/,(?!\s)/)),
            []
        );
        this.jar.setCookies(fixedCookies);
    }
}
891168
public static boolean addCookie(Cookie cookie, HttpServletResponse response) {
        if (Checker.isNotNull(cookie) && Checker.isNotNull(response)) {
            response.addCookie(cookie);
            return true;
        }
        return false;
    }
1239985
public function addCookieDescriptors($cookies)
  {
    $cnt = count($cookies);
    for ($x=0; $x<$cnt; $x++)
    {
      $this->addCookieDescriptor($cookies[$x]);
    }
  }
692743
def add_cookie(self, key, value, **attrs):
        '''
        
        '''
        if attrs:
            c = Morsel()
            c.set(key, value, **attrs)
            self.cookies[key] = c
        else:
            self.cookies[key] = value
873812
def set(self, name, value, domain, **kwargs):
        

        if domain == 'localhost':
            domain = ''

        self.cookiejar.set_cookie(create_cookie(name, value, domain, **kwargs))
533069
public void setCookies(List<HttpCookie> cookies) {
		Map<String, HttpCookie> map = new HashMap<String, HttpCookie>();
		for (HttpCookie cookie : cookies) {
			map.put(cookie.getName(), cookie);
		}
		this.cookies = map;
	}
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);
    }