Solved: Exceeded Allowed Session Max Size in Magento 2
Facing the error – exceeded allowed session max size in Magento 2? We’ve got you covered. Read this micro-post to solve the Magento 2 session size exceeded issue.
One of our clients recently rushed to us with a similar problem.
The client was not able to create orders from the admin panel after upgrading the Magento version.
Every time they add products to the order, the admin panel logs out automatically.
On checking the Magento 2 error logs, I found the following:
report.WARNING: Session size of 276448 exceeded allowed session max size of 256000
From the above warning, it appears that the Magento 2 session size is limited by the configuration. This can be easily solved by increasing the session size value or disabling the limit.
But let’s first understand a bit about Session management in Magento 2.
Session Management in Magento 2
In Magento 2, Session management is used to prevent Denial of Service (DoS) attacks. It prevents the exploitation of the Magento 2 API from overwhelming requests.
A Session is a sequence of HTTP requests and responses between a user and a server. Magento 2 provides an option to limit the size of session (i.e. the maximum allowed size of data transfer) as an anti-DoS practice. The maximum session size can be set for admin as well as customers. You can set the maximum allowed session size in bytes.
For example, let’s say the maximum session size is set to 256000 bytes, and the admin session exceeds this limit. In this case, the admin session will expire, and the error log will display – report.WARNING: Session size of XXXXXX exceeded allowed session max size of 256000.
Related Read: Magento 2 Admin Login Not Working
Now, let’s understand the method to fix the Magento session size exceeded issue.
How to Solve ‘exceeded allowed session max size’ in Magento 2
The ‘exceeded allowed session max size’ error in Magento 2 can be solved by disabling the max session size for admin. This can be done by setting the Max Session Size in Admin to 0. You can do this in two ways—either through the admin panel or by running a command.
Follow these steps to disable the maximum session size in Magento 2:
- On the Magento Admin sidebar, navigate to Stores > Settings > Configuration.
- Now, in the left panel, choose System under Advanced.
- Expand the Security section to configure the session settings.
- Set Maximum Session Size in Admin to 0 and Save the settings.
Alternatively, you can run the following command to disable the max session size for admin:
php bin/magento config:set system/security/max_session_size_admin 0
That’s it! The Magento 2 exceeded allowed session max size issue will be definitively solved.
Found this solution helpful? Share it with your friends on social media.
(Comment if you have any further queries or doubts!)
Thank You! 🍀
Siddharth Nandava
Siddharth Nandava is an enthusiastic Jr Magento developer at Meetanshi. Apart from the work, you can find him learning new things and spending quality time with his family.
Prev
Learn to Create Order in Magento 2 Admin Panel
Actionable Content Marketing Strategy For E-Commerce (+ Expert Opinions)
Next