Sets a session variable in an application context

@param string $name
@param mixed  $value
166417
public function set($name, $value)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        $context->is_dirty = true;
        $context->_SESSION[$name] = $value;
    }
61019
final public function set($varname, $value = NULL, $namespace = 'default')
    {
        //stores a value to a varname in a namespace of this session
        $session = $this;

        if (!isset($namespace) || empty($namespace)) {
            //@TODO Throw an exception, we need a name or use the default;
            throw new Exception("Cannot set new Session variable to unknown '{$namespace}' namespace");
            return false;
        }


        //If we don't have a registry to that namespace;
        if (!isset($session->registry[$namespace])) {
            //Create it;
            $registry = new Registry($namespace);
            $session->registry[$namespace] = $registry;
        }

        //echo $namespace;
        //@TODO, check if the regitry is not locked before adding
        if (!$session->isLocked($namespace)) {
            $registry = $session->getNamespace($namespace);
            $registry->set($varname, $value);
        }
        //If auth is locked

        return $session;
    }
540243
@Override
    public void setProperty(String name, Object value) {
        session.setProperty(name, value);
    }
679153
public static function setConfigValue($name, $value)
    {
        $section = self::getConfig();
        $section[$name] = $value;
        Config::getInstance()->Tracker = $section;
    }
550517
protected static function set(string $name, string $value): void
    {
        $name = \trim($name);

        if (
            (isset($name[0]) && $name[0] === '#') ||
            (static::$immutable && static::get($name) !== null)
        ) {
            return;
        }

        static::$names[] = $name;
        $value = \trim($value);

        // If PHP is running as an Apache module and an existing
        // Apache environment variable exists, overwrite it
        if (
            \function_exists('\\apache_setenv') &&
            \function_exists('\\apache_getenv') &&
            \apache_getenv($name) !== false
        ) {
            \apache_setenv($name, $value);
        }

        if (\function_exists('\\putenv')) {
            \putenv("$name=$value");
        }

        $_ENV[$name] = $value;
        $_SERVER[$name] = $value;
    }
1267946
public static function set($name, $value)
    {
        return (self::has($name) !== true) ? $_SESSION[$name] = $value : false;
    }
644173
public function setSessionValue($name, $value)
    {
        // In Laravel 5.4 the session changed to use their own custom implementation
        // instead of the one from Symfony. One of the changes was the set method
        // that was changed to put. Here we check if we are using the new one.
        if (method_exists($this->session, 'driver') && $this->session->driver() instanceof \Illuminate\Contracts\Session\Session) {
            $this->session->put($name, $value);
            return;
        }
        $this->session->set($name, $value);
    }
220399
public function set($name, $value)
    {
        $value = $this->normalizeValue($value);
        
        $this->remove($name);
        $this->setHeader($name, $value);
    }
142650
public static function setEnvironmentVariable($name, $value = null)
        {
            list($name, $value) = static::normaliseEnvironmentVariable($name, $value);

            // Don't overwrite existing environment variables if we're immutable
            // Ruby's dotenv does this with `ENV[key] ||= value`.
            if (true === static::$immutable && false === is_null(static::findEnvironmentVariable($name))) {
                return;
            }

            putenv("$name=$value");

            $_ENV[$name] = $value;
            $_SERVER[$name] = $value;
        }
490693
public function setCookie($name, $value = null) {
    if ($value === null) {
      $this->browser->removeCookie($name);
    }
    //TODO: set the cookie with domain, not with url, meaning www.aaa.com or .aaa.com
    if ($value !== null) {
      $urlData = parse_url($this->getCurrentUrl());
      $cookie = array("name" => $name, "value" => $value, "domain" => $urlData["host"]);
      $this->browser->setCookie($cookie);
    }
  }
514814
public function set(string $name, string $value): void
    {
        $this->parameters[$name] = $value;
    }
439818
public function set($name, $value)
    {
        if (null !== $this->parser) {
            list($name, $value) = call_user_func($this->parser, $name, $value);
        }

        $this->options[$name] = $value;
    }
536417
public function setOption($name, $value)
    {
        if ($name == 'cached_entity') {
            $this->setCachedEntity($value);
        } else {
            parent::setOption($name, $value);
        }
    }
589594
public function setValue($name, $value = '')
    {
        if (\is_array($name)) {
            foreach ($name as $key => $val) {
                if (isset($this->$key)) {
                    $this->$key = $val;
                }
            }
        } else {
            if (isset($this->$name)) {
                $this->$name = $value;
            }
        }
    }
470324
public function setPersistentState($name, $value) {
		
		$name = static::getCookiePrefix() . ucfirst($name);
		
		$this->persistentState[$name] = $value;
				
		setcookie($name, json_encode($value), NULL, '/');
		
	}
760857
public function setVar($name, $value)
    {
        $context = $this->_context;

        $context->vars[$name] = $value;

        return $this;
    }
908196
public function flash(string $name, $value): void
        {
            if ($this->has($name)) {
                $this->remove($name);
            } else {
                $this->set($name, $value);
            }
        }