Sets value to session storage.

@param string $key
@param mixed  $value

@return $this
974531
public function set($key, $value = null)
    {
        if ($key === null) {
            array_push($this->storage, $value);

            return $this;
        }

        if (is_array($key)) {
            foreach ($key as $key => $value) {
                $this->storage[$key] = $value;
            }

            return $this;
        }

        $this->setValueToStack($this->storage, explode(self::SEPARATOR, $key), $value);

        return $this;
    }
1249783
public function push($value, $key = null)
    {
        if ($key == null) {
            $this->storage[] = $value;
        } else {
            $this->storage[$key] = $value;
        }

        return $this;
    }
615474
public function session($key = null, $value = null)
    {
        if (! is_null($key))
        {
            return $this->client->request('session-set', array($key => $value));
        }

        return $this->client->request('session-get');
    }
470713
public function set( $key, $value ) {
		$key = $this->addKeyprefixIfNeeded( $key );
		$this->params[$key] = $value;
		return $this;
	}
330835
public function set($key, $value): self
    {
        $this->generatorToArray();

        $this->internalSet($key, $value);

        return $this;
    }
916808
public function put($key, $value)
    {
        return $this->session->put($this->path.$key, $value);
    }
1285591
public function set($key, $value)
    {
        if (!$key) {
            throw new \InvalidArgumentException('Missing Key in Session Set Method');
        }
        $this->sessionData[$key] = $value;

        return $this;
    }
940682
public function set($name, $value)
    {
        parent::set($name, $value);

        $_SESSION[$name] = $value;

        return $this;
    }
301157
function set($key, $value)
    {
        \Poirot\Storage\assertKey($key);

        $this->data[$key] = $value;
        return $this;
    }
1106261
public function set($key, $value = null)
    {
        if (!$this->offsetExists($key)) {
            $this->storage[$key] = $value;
        }

        return $this;
    }
1002720
public function setPermission($key, $value)
    {
        if (empty($value)) {
            $value = self::GUEST;
        }

        if ($key == 'access') {
            $this->access = $value;
        } else {
            $permission = clone $this->permissions;
            $permission[$key] = $value;
            $this->set('permissions', $permission);
        }

        return $this;
    }
340551
public function set($key, $value)
        {
            $this->values[$this->normalizeKey($key)] = $value;

            return $this;
        }
379165
protected function _setCached( $key, $value )
	{
		$session = $this->_getContext()->getSession();

		$cached = $session->get( 'arcavias/basket/cache', array() ) + array( $key => true );
		$session->set( 'arcavias/basket/cache', $cached );
		$session->set( $key, $value );
	}
1151431
public static function setState($key, $value)
	{
		$session  = self::$app->get('session');
		$registry = $session->get('registry');

		if (!is_null($registry))
		{
			return $registry->set($key, $value);
		}

		return null;
	}
255508
public function setFlash($key, $value) {
		if (!$this->started) {
			return $this;
		}

		$_SESSION[$this->nextFlashSessionKey][$key] = $value;
		return $this;
	}
1130152
public function offsetSet($key, $value)
    {
        if ($key !== null) {
            $this->data[$key] = $value;
        } else {
            $this->data[] = $value;
        }

        return $this;
    }
190820
public function set(string $key, $value): self
    {
        $this->options[$key] = $value;

        return $this;
    }