{"id":703,"date":"2019-12-04T06:09:35","date_gmt":"2019-12-04T06:09:35","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/12\/04\/solution-your-session-has-expired-on-clicking-add-to-cart-in-magento-2-3-localhost\/"},"modified":"2025-05-22T15:17:11","modified_gmt":"2025-05-22T09:47:11","slug":"solution-your-session-has-expired-on-clicking-add-to-cart-in-magento-2-3-localhost","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solution-your-session-has-expired-on-clicking-add-to-cart-in-magento-2-3-localhost\/","title":{"rendered":"Solved &#8211; \u201cYour session has expired\u201d On Clicking Add To Cart In Magento 2.3 Localhost"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you have been too much into Magento like me, you might have experienced an error that says &#8220;<strong>Your session has expired<\/strong>&#8221; on clicking add to cart in Magento 2.3 localhost.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This may happen when you have installed a fresh Magento 2.3 at local and trying test product functionality by adding to the cart.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To resolve the issue, try the below solution to get rid of the expired session error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution For &#8220;Your Session Has Expired&#8221; On Clicking Add To Cart In Magento 2.3 Localhost:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use 127.0.0.1 instead of localhost<\/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=\"\">UPDATE core_config_data&amp;nbsp;SET value&amp;nbsp;= 'http:\/\/127.0.0.1\/mag233sample\/' WHERE core_config_data.path&amp;nbsp;= 'web\/unsecure\/base_url';\nUPDATE core_config_data&amp;nbsp;SET value&amp;nbsp;= 'http:\/\/127.0.0.1\/mag233sample\/' WHERE core_config_data.path&amp;nbsp;= 'web\/secure\/base_url';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u201chttp:\/\/127.0.0.1\/mag233sample\/\u201d is localhost homepage URL<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the command:<\/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=\"\">php bin\/magento cache:flush<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the solution with the fellow developers via social media!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have been too much into Magento like me, you might have experienced an error that says &#8220;Your session has expired&#8221; on clicking add&#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-703","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/703","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=703"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions"}],"predecessor-version":[{"id":15159,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions\/15159"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}