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 @@ -284,6 +284,11 @@ $this->writeSafeHandler = $handler; } + /** + * Returns the built-in PHP session handler. + * + * @return string + */ public function getPHPSessionHandler() { return $this->PHPSessionHandler; } diff -u b/core/modules/file/file.es6.js b/core/modules/file/file.es6.js --- b/core/modules/file/file.es6.js +++ b/core/modules/file/file.es6.js @@ -222,11 +222,14 @@ if ($progressId.length) { const originalName = $progressId.attr('name'); - // Replace the name with the last string in the name that does not - // contain square brackets. + // Replace the name with the required identifier to ensure that this + // element sends its upload identifier. The upload identifier is the + // last string in the name that does not contain square brackets. $progressId.attr('name', originalName.match(/[^\[\]]+(?!.*[^\[\]]+)/)[0]); - // Restore the original name after the upload begins. + // Restore the original name after the upload begins to prevent this + // element from sending its upload identifier with another element’s + // upload. setTimeout(() => { $progressId.attr('name', originalName); }, 1000); 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 @@ -77,25 +77,23 @@ // one generated by Drupal so PHP can recognize the browser’s cookie // before Drupal starts. + // Stop the Drupal session temporarily. Save the session handler and data + // so we can resume it later. $save_handler = session_module_name(); $session = $_SESSION; - - // Stop the current session without saving any data to keep your original data - // in your path. session_abort(); - // Get upload status from the built-in PHP session data. + // Get upload status from the PHP session. $status = []; session_module_name($this->PHPSessionHandler); - // Fail silently if built-in PHP session handler generates an error. + // Fail silently if the PHP session handler generates an error. @session_start(); $prefix = ini_get('session.upload_progress.prefix'); if (isset($_SESSION[$prefix . $key])) { $status = $_SESSION[$prefix . $key]; } - // Close the built-in PHP session without saving and restore the current - // session. + // Stop the PHP session and resume the Drupal session. session_abort(); session_module_name($save_handler); session_start();