original_string: public function write($key, $value = null)
      {
          if (!is_array($key)) {
              $key = [$key => $value];
          }
  
          $keys = [];
          foreach ($key as $name => $value) {
              $this->_load($name);
  
              $this->_values = Hash::insert($this->_values, $name, $value);
              $parts = explode('.', $name);
              $keys[] = $parts[0];
          }
  
          foreach ($keys as $name) {
              $this->_write($name, $this->_values[$name]);
          }
      }
code: public function write($key, $value = null)
      {
          if (!is_array($key)) {
              $key = [$key => $value];
          }
  
          $keys = [];
          foreach ($key as $name => $value) {
              $this->_load($name);
  
              $this->_values = Hash::insert($this->_values, $name, $value);
              $parts = explode('.', $name);
              $keys[] = $parts[0];
          }
  
          foreach ($keys as $name) {
              $this->_write($name, $this->_values[$name]);
          }
      }
code_tokens: public function write ( $ key , $ value = null ) { if ( ! is_array ( $ key ) ) { $ key = [ $ key => $ value ] ; } $ keys = [ ] ; foreach ( $ key as $ name => $ value ) { $ this -> _load ( $ name ) ; $ this -> _values = Hash :: insert ( $ this -> _values , $ name , $ value ) ; $ parts = explode ( '.' , $ name ) ; $ keys [ ] = $ parts [ 0 ] ; } foreach ( $ keys as $ name ) { $ this -> _write ( $ name , $ this -> _values [ $ name ] ) ; } }
docstring: Write a value to the response cookies.
  
  You must use this method before any output is sent to the browser.
  Failure to do so will result in header already sent errors.
  
  @param string|array $key Key for the value
  @param mixed $value Value
  @return void
docstring_tokens: Write a value to the response cookies .