Drupal 10.3.x Update Introduces Unconditional Session Object Addition

Drupal

The latest change in the Drupal 10.3.x branch introduces an unconditional addition of a session object supported by Symfony MockArraySessionStorage to every request in DrupalKernel::preHandle(). This leads to the automatic availability of a session on every request within specific environments, including tests inheriting from KernelTestBase, tests using FunctionalTestSetupTrait::initKernel(), as well as Drush and Drupal console commands. This impact is pertinent to test code and command line utilities, with no alteration to the availability of the session backed by persistent storage in production code. 

The deprecations associated with this change warn that pushing requests without a session onto the request_stack is deprecated in Drupal 10.3.0, with an error to be enforced from Drupal 11.0.0 onwards. The comprehensive update is relevant to module developers, distribution developers, and other updates. The documentation in support of this change record remains pending. The author, znerol, highlighted the nuances and impact of the latest Drupal core update.  

Source Reference

Date of Publication
URL
https://www.drupal.org/node/3337193

Disclosure: This content is produced with the assistance of AI.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please let us know in the comments below and we will try to address the issue as best we can.

Advertisement Here

Call for Support