• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/session/legacy/healerearlysessionstart.php
  • Класс: BitrixMainSessionLegacyHealerEarlySessionStart
  • Вызов: HealerEarlySessionStart::process
public function process(SessionInterface $kernelSession)
{
	if (($kernelSession instanceof KernelSessionProxy) && $kernelSession->isActive() && !$kernelSession->isStarted())
	{
		session_write_close();

		$exception = new SystemException(
			'Attention! The session_start function was called before the Bitrix Kernel was started. ' .
			'The session will be closed to avoid errors. It's strongly recommended to avoid session usage before initializing the Bitrix Kernel.'
		);
		trigger_error($exception->getMessage(), E_USER_DEPRECATED);
		$application = BitrixMainApplication::getInstance();
		$exceptionHandler = $application->getExceptionHandler();
		$exceptionHandler->writeToLog($exception);
	}
}