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

2023-07-01--03-59-58

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

I also recommend to fix it for the frontend too.

The same error: «Session size of <…> exceeded allowed session max size of <…>».