public function set($name, $value = null, $namespace = null)
    {
        // Get the old value of the variable
        $old = $this->get($name, $namespace);

        // Get SESSION Namespace
        $namespace = $this->getNamespace($namespace);

        if (is_null($value)) {
            unset($_SESSION[$namespace][$name]);
        } else {
            $_SESSION[$namespace][$name] = $value;
        }

        return $old;
    }
public function set($name, $value = null, $namespace = null)
    {
        // Get the old value of the variable
        $old = $this->get($name, $namespace);

        // Get SESSION Namespace
        $namespace = $this->getNamespace($namespace);

        if (is_null($value)) {
            unset($_SESSION[$namespace][$name]);
        } else {
            $_SESSION[$namespace][$name] = $value;
        }

        return $old;
    }
public function set ( $ name , $ value = null , $ namespace = null ) { // Get the old value of the variable $ old = $ this -> get ( $ name , $ namespace ) ; // Get SESSION Namespace $ namespace = $ this -> getNamespace ( $ namespace ) ; if ( is_null ( $ value ) ) { unset ( $ _SESSION [ $ namespace ] [ $ name ] ) ; } else { $ _SESSION [ $ namespace ] [ $ name ] = $ value ; } return $ old ; }
Set a session variable value.

@param string $name      The name of the variable.
@param string $value     The value with which the variable will be set. Set to null to unset variable.
@param string $namespace The namespace of the session variable.

@return mixed The old value of the variable, or null if not set.
Set a session variable value .