• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/httpresponse.php
  • Класс: BitrixMainHttpResponse
  • Вызов: HttpResponse::writeHeaders
public function writeHeaders()
{
	$this->flushStatus();

	if ($this->lastModified !== null)
	{
		$this->flushHeader(['Last-Modified', gmdate('D, d M Y H:i:s', $this->lastModified->getTimestamp()) . ' GMT']);
	}

	foreach ($this->getHeaders() as $name => $values)
	{
		if (is_array($values))
		{
			foreach ($values as $value)
			{
				$this->flushHeader([$name, $value]);
			}
		}
		elseif ($values !== '')
		{
			$this->flushHeader([$name, $values]);
		}
		else
		{
			$this->flushHeader($name);
		}
	}

	$cookiesCrypter = new WebCookiesCrypter();
	foreach ($this->cookies as $cookie)
	{
		if (!$cookiesCrypter->shouldEncrypt($cookie))
		{
			$this->setCookie($cookie);
		}
		else
		{
			/** @var WebCryptoCookie $cookie */
			foreach ($cookiesCrypter->encrypt($cookie) as $cryptoCookie)
			{
				$this->setCookie($cryptoCookie);
			}
		}
	}
}