src/Http/Cookie/Cookies.php
public function offsetSet($name, $value)
    {
        $cookie = $this->_classes['cookie'];
        $value = $this->_autobox($name, $value);
        if (!$value instanceof $cookie) {
            throw new RuntimeException("Error, only `{$cookie}` instances are allowed in this collection.");
        }
        $hash = $name . ';' . $value->domain() . ';' . $value->path();
        $this->_hashes[$name][] = $hash;
        $this->_names[$hash] = $name;

        return $this->_data[$hash] = $value;
    }
public function offsetSet($name, $value)
    {
        $cookie = $this->_classes['cookie'];
        $value = $this->_autobox($name, $value);
        if (!$value instanceof $cookie) {
            throw new RuntimeException("Error, only `{$cookie}` instances are allowed in this collection.");
        }
        $hash = $name . ';' . $value->domain() . ';' . $value->path();
        $this->_hashes[$name][] = $hash;
        $this->_names[$hash] = $name;

        return $this->_data[$hash] = $value;
    }
public function offsetSet ( $ name , $ value ) { $ cookie = $ this -> _classes [ 'cookie' ] ; $ value = $ this -> _autobox ( $ name , $ value ) ; if ( ! $ value instanceof $ cookie ) { throw new RuntimeException ( "Error, only `{$cookie}` instances are allowed in this collection." ) ; } $ hash = $ name . ';' . $ value -> domain ( ) . ';' . $ value -> path ( ) ; $ this -> _hashes [ $ name ] [ ] = $ hash ; $ this -> _names [ $ hash ] = $ name ; return $ this -> _data [ $ hash ] = $ value ; }
Adds a cookie to the collection.

@param  string $name  The cookie name.
@param  object $value The cookie.
@return object        The setted cookie.
Adds a cookie to the collection .