public function set($name, $value)
    {
        $name = self::escapeValue($name);

        // Delete value if $value === null
        if (is_null($value)) {
            if ($this->keyStore === false) {
                unset($this->value[$name]);
                return;
            }
            unset($this->value[$this->keyStore][$name]);
            return;
        }

        if ($this->keyStore === false) {
            $this->value[$name] = $value;
            return;
        }

        $this->value[$this->keyStore][$name] = $value;
    }
public function set($name, $value)
    {
        $name = self::escapeValue($name);

        // Delete value if $value === null
        if (is_null($value)) {
            if ($this->keyStore === false) {
                unset($this->value[$name]);
                return;
            }
            unset($this->value[$this->keyStore][$name]);
            return;
        }

        if ($this->keyStore === false) {
            $this->value[$name] = $value;
            return;
        }

        $this->value[$this->keyStore][$name] = $value;
    }
public function set ( $ name , $ value ) { $ name = self :: escapeValue ( $ name ) ; // Delete value if $value === null if ( is_null ( $ value ) ) { if ( $ this -> keyStore === false ) { unset ( $ this -> value [ $ name ] ) ; return ; } unset ( $ this -> value [ $ this -> keyStore ] [ $ name ] ) ; return ; } if ( $ this -> keyStore === false ) { $ this -> value [ $ name ] = $ value ; return ; } $ this -> value [ $ this -> keyStore ] [ $ name ] = $ value ; }
Registers a new name => value association in the cookie.

Registering new values is optimal if the value is a numeric value.
If the value is a string, it will be saved as a base64 encoded string.
If the value is an array, it will be saved as a serialized and base64 encoded
string which is not very good in terms of bytes usage.
You should save arrays only when you are sure about their maximum data size.
A cookie has to stay small and its size shouldn't increase over time!

@param string $name Name of the value to save; the name will be used to retrieve this value
@param string|array|number $value Value to save. If null, entry will be deleted from cookie.
Registers a new name = > value association in the cookie .