Admin login not working - allowed session max size exceeded

This article provides a fix for when you try to log in to your Admin panel but the form just refreshes and you are unable to log in. This is because the Admin Session Size has been exceeded.

Affected versions

Issue

It is impossible to log in to the Admin, because the form keeps reloading.

Cause

The allowed session max size is exceeded.

Solution

Check the var/log/support_report.log file for errors such as these:

[2023-07-13T04:26:09.792060+00:00] report.WARNING: Session size of 260572 exceeded allowed session max size of 256000. [] []
[2023-07-13T04:26:17.056714+00:00] report.WARNING: Session size of 260570 exceeded allowed session max size of 256000. [] []

If you see these errors, the solution would be:

Adobe Commerce on-premises:

  1. Increase the Max Session Size in Admin value from the backend configuration. To do so go to Stores > Settings > Configuration > Advanced > System > Security > Max Session Size in Admin.
  2. Set the value to 500000 or higher. Depending on the existing max size reported in the error - you also could set the value to 0 which will remove the session size limit.

Adobe Commerce on cloud infrastructure:

(This setting is only accessible in the Admin when the deployment/operation mode is default or developer. However, only the Production deployment mode is allowed in the Cloud environment.)

To increase this value, run this command in the terminal (SSH):

bin/magento config:set system/security/max_session_size_admin 500000

You can set to higher than 500000 depending on the existing max size reported in the error and you can also set the value to 0 to remove the session size limit.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a