concrete/src/Cookie/ResponseCookieJar.php
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;
    }
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;
    }
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 ; }
Adds a Cookie object to the array of cookies for the object.

@param \Symfony\Component\HttpFoundation\Cookie $cookie

@return $this
Adds a Cookie object to the array of cookies for the object .