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);
    }
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);
    }
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 ) ; }
Writes value to given session variable name.

@param string|array $name Name of variable
@param mixed $value Value to write
@return void
Writes value to given session variable name .