original_string: public function write($name, $value = null)
      {
          if (!$this->started()) {
              $this->start();
          }
  
          $write = $name;
          if (!is_array($name)) {
              $write = [$name => $value];
          }
  
          $data = isset($_SESSION) ? $_SESSION : [];
          foreach ($write as $key => $val) {
              $data = Hash::insert($data, $key, $val);
          }
  
          $this->_overwrite($_SESSION, $data);
      }
code: public function write($name, $value = null)
      {
          if (!$this->started()) {
              $this->start();
          }
  
          $write = $name;
          if (!is_array($name)) {
              $write = [$name => $value];
          }
  
          $data = isset($_SESSION) ? $_SESSION : [];
          foreach ($write as $key => $val) {
              $data = Hash::insert($data, $key, $val);
          }
  
          $this->_overwrite($_SESSION, $data);
      }
code_tokens: public function write ( $ name , $ value = null ) { if ( ! $ this -> started ( ) ) { $ this -> start ( ) ; } $ write = $ name ; if ( ! is_array ( $ name ) ) { $ write = [ $ name => $ value ] ; } $ data = isset ( $ _SESSION ) ? $ _SESSION : [ ] ; foreach ( $ write as $ key => $ val ) { $ data = Hash :: insert ( $ data , $ key , $ val ) ; } $ this -> _overwrite ( $ _SESSION , $ data ) ; }
docstring: Writes value to given session variable name.
  
  @param string|array $name Name of variable
  @param mixed $value Value to write
  @return void
docstring_tokens: Writes value to given session variable name .