• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/session/handlers/cookiesessionhandler.php
  • Класс: BitrixMainSessionHandlersCookieSessionHandler
  • Вызов: CookieSessionHandler::read
public function read($sessionId)
{
	$value = $this->request->getCookie($sessionId) ?: '';
	if (!$value)
	{
		return '';
	}

	try
	{
		$decoded = Json::decode($value);
	}
	catch (ArgumentException $exception)
	{
		return '';
	}

	if (is_array($decoded))
	{
		if (!isset($decoded['expires']))
		{
			return $decoded['data'];
		}
		if (time() <= $decoded['expires'])
		{
			return $decoded['data'];
		}
	}

	return '';
}