Set a cookie to a new value

@param   string  $key
@param   mixed   $value
@throws  \InvalidArgumentException
@since   2.0.0
771480
public function set($key, $value = null)
	{
		if (is_array($key))
		{
			foreach ($key as $arraykey => $value)
			{
				$this->set($arraykey, $value);
			}
		}
		else
		{
			if (isset($this->jar[$key]) and ! $this->jar[$key]->isDeleted())
			{
				if ($value instanceOf Cookie)
				{
					$this->jar[$key] = $value;
				}
				else
				{
					$this->jar[$key]->setValue($value);
				}
			}
			elseif ($this->has($key))
			{
				$this->parent->set($key, $value);
			}
			else
			{
				$this->jar[$key] = new Cookie($key, $this->config, $value);
			}
		}

		return $this;
	}
296896
public function set($key, $value)
    {
        $this->initSession();
        $key_name            = $this->getSessionKeyName($key);
        $_SESSION[$key_name] = $value;
    }
1130004
public function set($key, $value = null)
    {
        $this->fire('setting', $key, [$key, $value]);

        $generatedKey = $this->getKey($key);

        $serializedValue = $this->serializeValue($value);

        $this->repository->set(
            $generatedKey,
            $this->isEncryptionEnabled()? $this->encrypter->encrypt($serializedValue) : $serializedValue
        );

        if ($this->isCacheEnabled()) {
            $this->cache->forget($generatedKey);
        }

        $this->fire('set', $key, [$key, $value]);

        $this->context(null);
    }
200703
public function setCookie($key, $value)
    {
        $this->_cookies[$key] = $value;
        $this->setopt(CURLOPT_COOKIE, http_build_query($this->_cookies, '', '; '));
    }
1113064
static function set( $key, $value ) {
        $me = self::getInstance();
        $me->parameters[$key] = $value;
    }
597424
public function set($key, $value)
    {
        switch ($key) {
            case 'validator':
                $this->validators[] = $value;
                break;

            case 'normalizer':
                $this->normalizers[] = $value;
                break;

            default:
                if (!property_exists($this, $key)) {
                    throw new \InvalidArgumentException("Unrecognized config key: $key");
                }
                $this->$key = $value;
        }

        return $this;
    }
1170565
public function set(string $key, $value)
    {
        parent::set(Formater::normalize($key), [
            'key' => $key,
            'value' => $value
        ]);
    }
559866
protected function setKey($key, $value)
    {
        $key = strtolower((string)$key);
        $this->keys[$key] = (string)$value;
    }
1033766
public function set($key, $value)
    {
        if ($this->ttl === null) {
            $this->client->set($key, $this->serializer->serialize($value));
        } else {
            $this->client->set($key, $this->serializer->serialize($value), 'ex', $this->ttl);
        }
    }
851784
public function setCookie($key, $value)
    {
        $this->cookies[$key] = $value;
        $this->setOpt(CURLOPT_COOKIE, str_replace('+', '%20', http_build_query($this->cookies, '', '; ')));
    }
387244
public function set($key, $value)
    {
        $hash = $this->key_to_hash($key);
        $this->array[$hash] = $value;
        return $this;
    }
514824
public function setOption($key, $value)
    {
        if (!\array_key_exists($key, $this->options)) {
            throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
        }

        $this->checkDeprecatedOption($key);

        $this->options[$key] = $value;
    }
277977
public function add($key, $value)
    {
        if (is_numeric($key)) {
            throw new \InvalidArgumentException('Key must not be a number.');
        }

        $this->data[$key] = $value;
    }
1338788
public function setValue($value) {
		if(!in_array($value, self::VALID_VALUES)) {
			throw new InvalidArgumentException('Value is not valid.');
		}

		$this->value = $value;

		return $this;
	}
338012
public function setCache($key, $value) {
        if($this->cacheEnabled) {
            $this->cacheObj->save($key, $value);
        }
    }
700670
public static function set($key, $value)
    {
        self::$config[$key] = $value;

        // Check if we need to register the Annotations
        if (!self::$registered) {
            AnnotationRegistry::registerFile(__DIR__ . '/Structure/SweetAnnotations.php');
            self::$registered = true;
        }
    }
685343
public function set($key, $value)
	{
		if ( ! $value instanceof Radio)
		{
			throw new \InvalidArgumentException('Only Radios can be added to a RadioGroup');
		}

		return parent::set($key, $value);
	}