9

I need to know, Is there any side issues, if we increase the below path size more than max in config file.

system/security/max_session_size generally as per magento max size is 256000 

Can we increase more then 256000 until which limit can we extend the size.

Anyone who know ever used or know please answer my question so It can solve my problem.

1
  • Are you getting any errors because of this? We were, checked the logs, system was trying to use around 400, we set it to 512. Errors are gone now
    – Dan Staver
    Feb 17, 2022 at 4:45

5 Answers 5

19

Magento 2.4.3 introduces a setting for max session size with default value 256000.

To increase the max session size for admin and prevent Session size of 123456 exceeded allowed session max size of 256000. error, you can change this setting from command line, e.g.:

php bin/magento config:set system/security/max_session_size_admin 1024000.

or:

php bin/magento config:set system/security/max_session_size_admin 0

to disable this completely (not recommended).

1

Please see https://docs.magento.com/user-guide/stores/security-session-management.html for more accurate guidance. 256000 is more of a minimum than maximum value.

What works may vary depending on the version of Magento, in 2.4.x, based on anecdotal evidence - a successful admin login might not proceed pass the login page if max_session is set too low.

1
  • right, couldn't login to the admin panel after upgrading to 2.4.4 as the config show didn't show a value for system/security/max_session_size_admin, now I can login.
    – cnu
    Sep 12, 2022 at 14:54
1

You can increase this value but you should not disable it because it helps prevent DDoS attacks. You can increase the default value for system/security/max_session_size_admin to 512000 and see if that works. If not you can try increasing it more. Please see these two links for more details:

https://docs.magento.com/user-guide/stores/security-session-management.html https://github.com/magento/magento2/issues/33748

1

Thanks for above solutions. I also encountered this similar issue after upgrade magento from 2.4.1 to 2.4.4-p2. Admin user login admin site, the login should be success, but it still stay the login page, and also without any errors in browser. Checked the backend logs, found the followig error:

report.WARNING: Session size of 546945 exceeded allowed session max size of 256000.

I follow the above solution to increase the maximum session size. And then admin user can login admin site and access admin relevant pages.

bin/magento config:set system/security/max_session_size_admin 768000
0

Yes,You can increase or adjust it as per your need.

256000 is just a default config value.

It will not cause any critical issue.


Even you can disable it too through putting 0 in field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.