{"id":1712,"date":"2021-04-16T12:26:01","date_gmt":"2021-04-16T12:26:01","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solution-warning-session-handler-read-in-magento-2\/"},"modified":"2025-07-16T18:10:07","modified_gmt":"2025-07-16T12:40:07","slug":"solution-warning-session-handler-read-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solution-warning-session-handler-read-in-magento-2\/","title":{"rendered":"Solved: Warning: SessionHandler::read(): in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It is not new for the Magento developer to face an error or try out a new customized feature. However, experimenting with things in a live online store may cause the functional disorder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To avoid this risk, developers tend to move a live\u00a0Magento 2\u00a0website to a local server in order to try out new themes or a plugin and solve the major issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Have you tried to move your Magento 2 live store into a local server and faced any error that says:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Warning: SessionHandler::read():open failed: No such file or directory<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The exception looks like shown in the below image:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/04\/Screenshot-at-March-15th-2021-6.14.35-pm-1024x573.png\" alt=\"exception\" class=\"wp-image-14360\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If yes, I got your back.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s the solution to&nbsp;<em><strong>warning:SessionHandler::read(): in Magento 2<\/strong><\/em>&nbsp;store that you can refer to:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution to Warning: SessionHandler::read(): in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the below code in the&nbsp;<strong>env.php<\/strong>&nbsp;file at&nbsp;<strong>app\/etc<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">'session' =>\n  array (\n    'save' => 'files'\n  ),<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">with the below code:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">'session' =>\n  array (\n    'save' => 'db'\n  ),<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to share the solution with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is not new for the Magento developer to face an error or try out a new customized feature. However, experimenting with things in a&#8230;<\/p>\n","protected":false},"author":5,"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-1712","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1712","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1712"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1712\/revisions"}],"predecessor-version":[{"id":18125,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1712\/revisions\/18125"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}