• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/session/session.php
  • Класс: BitrixMainSessionSession
  • Вызов: Session::regenerateId
public function regenerateId(): bool
{
	if (!$this->isStarted())
	{
		return false;
	}

	$newSessionId = session_create_id();

	$this->set('newSid', $newSessionId);
	$this->set('destroyed', time());

	$backup = $this->sessionData;
	$this->saveWithoutReleaseLock();

	$this->disableStrictMode();
	$this->setId($newSessionId);
// Idea to switch on strict mode after setId is good. But in that case
// session_start will invoke validateId for one time more. So behavior in
// 7.1, 7.2 & 7.4 is different and now it's way to avoid that.
//		if ($prevStrictMode !== false)
//		{
//			ini_set('session.use_strict_mode', $prevStrictMode);
//		}

	$this->start();
	$this->enableStrictMode();

	$_SESSION = $backup;

	$this->remove('newSid');
	$this->remove('destroyed');

	return true;
}