diff -u b/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php --- b/core/lib/Drupal/Core/Session/SessionManager.php +++ b/core/lib/Drupal/Core/Session/SessionManager.php @@ -96,7 +96,7 @@ $this->connection = $connection; // Save the PHP session handler in case we need to retrieve session data - // that PHP stores before Drupal starts the session. + // that PHP stores before Drupal starts. $this->PHPSessionHandler = session_module_name(); parent::__construct($options, $handler, $metadata_bag); diff -u b/core/modules/file/file.module b/core/modules/file/file.module --- b/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -1076,7 +1076,7 @@ // We prefer the PECL extension uploadprogress because it supports multiple // simultaneous uploads. APCu only supports one at a time. PHP session - // upload progress only works if the other twe extensions are not enabled. + // upload progress only works if the other two extensions are not enabled. if (extension_loaded('uploadprogress')) { $implementation = 'uploadprogress'; } diff -u b/core/modules/file/src/Controller/FileWidgetAjaxController.php b/core/modules/file/src/Controller/FileWidgetAjaxController.php --- b/core/modules/file/src/Controller/FileWidgetAjaxController.php +++ b/core/modules/file/src/Controller/FileWidgetAjaxController.php @@ -13,11 +13,11 @@ class FileWidgetAjaxController implements ContainerInjectionInterface { /** - * The session manager. + * The PHP session handler. * - * @var \Drupal\Core\Session\SessionManagerInterface + * @var string */ - protected $sessionManager; + protected $PHPSessionHandler; /** * {@inheritdoc} @@ -33,7 +33,12 @@ * The session manager. */ public function __construct(SessionManagerInterface $session_manager) { - $this->sessionManager = $session_manager; + if (method_exists($session_manager, 'getPHPSessionHandler')) { + $this->PHPSessionHandler = $session_manager->getPHPSessionHandler(); + } + else { + $this->PHPSessionHandler = 'files'; + } } /** @@ -81,13 +86,9 @@ // Get upload status from the built-in PHP session data. $status = []; - if (method_exists($this->sessionManager, 'getPHPSessionHandler')) { - session_module_name($this->sessionManager->getPHPSessionHandler()); - } - else { - session_module_name('files'); - } - session_start(); + session_module_name($this->PHPSessionHandler); + // Fail silently if built-in PHP session handler generates an error. + @session_start(); $prefix = ini_get('session.upload_progress.prefix'); if (isset($_SESSION[$prefix . $key])) { $status = $_SESSION[$prefix . $key];