core-bundle/src/Resources/contao/library/Contao/Session.php
public function appendData($varData)
	{
		if (\is_object($varData))
		{
			$varData = get_object_vars($varData);
		}

		if (!\is_array($varData))
		{
			throw new \Exception('Array or object required to append session data');
		}

		foreach ($varData as $k=>$v)
		{
			// Map the referer (see #281)
			if (\in_array($k, $this->mappedKeys))
			{
				$this->session->set($k, $v);
			}
			else
			{
				$this->sessionBag->set($k, $v);
			}
		}
	}
public function appendData($varData)
	{
		if (\is_object($varData))
		{
			$varData = get_object_vars($varData);
		}

		if (!\is_array($varData))
		{
			throw new \Exception('Array or object required to append session data');
		}

		foreach ($varData as $k=>$v)
		{
			// Map the referer (see #281)
			if (\in_array($k, $this->mappedKeys))
			{
				$this->session->set($k, $v);
			}
			else
			{
				$this->sessionBag->set($k, $v);
			}
		}
	}
Append data to the session

@param mixed $varData The data object or array

@throws \Exception If $varData is not an array or object