{"id":2245,"date":"2023-08-15T07:30:43","date_gmt":"2023-08-15T07:30:43","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/exceeded-allowed-session-max-size-in-magento-2\/"},"modified":"2025-07-23T09:55:26","modified_gmt":"2025-07-23T04:25:26","slug":"exceeded-allowed-session-max-size-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/exceeded-allowed-session-max-size-in-magento-2\/","title":{"rendered":"Solved: Exceeded Allowed Session Max Size in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Facing the error \u2013&nbsp;exceeded allowed session max size in Magento 2? We\u2019ve got you covered. Read this micro-post to solve the Magento 2 session size exceeded issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of our clients recently rushed to us with a similar problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The client was not able to create orders from the admin panel after upgrading the Magento version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every time they add products to the order, the admin panel logs out automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On checking the&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/how-to-enable-error-logs-in-magento-2\/\">Magento 2 error logs<\/a>, I found the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>report.WARNING: Session size of 276448 exceeded allowed session max size of 256000<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But let\u2019s first understand a bit about Session management in Magento 2.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Session Management in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, let\u2019s 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 \u2013 report.WARNING: Session size of XXXXXX exceeded allowed session max size of 256000.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Related Read:&nbsp;<\/strong><a href=\"https:\/\/meetanshi.com\/blog\/admin-login-not-working-after-upgrading-to-magento-2-4-4\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Admin Login Not Working<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let\u2019s understand the method to fix the Magento session size exceeded issue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Solve \u2018exceeded allowed session max size\u2019 in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The \u2018exceeded allowed session max size\u2019 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\u2014either through the admin panel or by running a command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Follow these steps to disable the maximum session size in Magento 2:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On the Magento Admin sidebar, navigate to&nbsp;<strong>Stores &gt; Settings &gt; Configuration<\/strong>.<\/li>\n\n\n\n<li>Now, in the left panel, choose&nbsp;<strong>System<\/strong>&nbsp;under&nbsp;<strong>Advanced<\/strong>.<\/li>\n\n\n\n<li>Expand the&nbsp;<strong>Security<\/strong>&nbsp;section to configure the session settings.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2023\/08\/1-exceeded-max-allowed-session-size.png\" alt=\"Exceeded Max Allowed Session Size\" class=\"wp-image-32837\"\/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><em>Set Maximum Session Size<\/em>&nbsp;in Admin to&nbsp;<em>0<\/em>&nbsp;and&nbsp;<strong>Save<\/strong>&nbsp;the settings.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can run the following command to disable the max session size for admin:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>php bin\/magento config:set system\/security\/max_session_size_admin 0<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it! The Magento 2 exceeded allowed session max size issue will be definitively solved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Found this solution helpful? Share it with your friends on social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You!  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Facing the error \u2013&nbsp;exceeded allowed session max size in Magento 2? We\u2019ve got you covered. Read this micro-post to solve the Magento 2 session size&#8230;<\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2245","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=2245"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2245\/revisions"}],"predecessor-version":[{"id":19107,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2245\/revisions\/19107"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=2245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=2245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=2245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}