Your IP : 3.22.171.120


Current Path : /home/bitrix/ext_www/home-comfort.in.ua/bitrix/modules/main/lib/web/
Upload File :
Current File : /home/bitrix/ext_www/home-comfort.in.ua/bitrix/modules/main/lib/web/httpcookies.php

<?php
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage main
 * @copyright 2001-2014 Bitrix
 */
namespace Bitrix\Main\Web;

class HttpCookies extends \Bitrix\Main\Type\Dictionary
{
	public function __construct(array $values = null)
	{
		parent::__construct($values);
	}

	public function toString()
	{
		$str = "";
		foreach($this->values as $name => $value)
		{
			$str .= ($str == ""? "" : "; ").rawurlencode($name)."=".rawurlencode($value);
		}
		return $str;
	}

	public function addFromString($str)
	{
		if (($pos = strpos($str, ';')) !== false && $pos > 0)
		{
			$cookie = trim(substr($str, 0, $pos));
		}
		else
		{
			$cookie = trim($str);
		}
		$arCookie = explode('=', $cookie, 2);

		$this[rawurldecode($arCookie[0])] = rawurldecode($arCookie[1]);
	}
}