How to fix «Your current session has been expired» frontend error in Magento 2.3 ≥ 2.3.7 and Magento 2.4 ≥ 2.4.3?

bin/magento config:set system/security/max_session_size_storefront 9999999
bin/magento cache:clean

I also recommend to fix it for the backend too.