After updating from 2.3.5 to 2.4.4-p2 I am getting an error when the frontend loads. This is how it looks, when I load the frontend: https://i.stack.imgur.com/L1liN.png
The admin works just fine and there are no errors during cimpilation, upgrade or deployment. Any idea how to solve this? The error in the logs is: Error: Call to a member function getCookieSecure() on null in /vendor/magento/module-theme/view/frontend/templates/js/cookie.phtml:21
The code on line 21 is this:
"secure": <?= $block->getSessionConfig()->getCookieSecure() ? 'true' : 'false'; ?>,
It seems getSessionConfig returns null.
Running on PHP 8.1
Ideas?