Problem/Motivation
In #3392616-5: Update to Symfony 6.4 we've found out that the Symfony\Component\DependencyInjection\ContainerAwareTrait
and Symfony\Component\DependencyInjection\ContainerAwareInterface
are being deprecated in Symfony 6.4 and removed in 7.0.
Drupal\Core\StackMiddleware\Session is container aware because of the following comment:
* Note, the session service is not injected into this class in order to prevent
* premature initialization of session storage (database). Instead the session
* service is retrieved from the container only when handling the request.
SessionManager injects the database service but only uses it in the delete()
method.
Steps to reproduce
Proposed resolution
Inject the database service into SessionManager using a service closure
Inject the session service as normal into the Session middleware.