Your Session Has Expired Error in Magento 2 While Add to Cart Product

When we install Magento 2.3 on our local machine then some issue comes like your session has expired so that's why you can't add the product to the cart.

Let us know how to solve this problem.

Error: "Your session has expired"

I have done a fresh installation of Magento 2.3 and I am facing a problem "Your session has expired" while adding product to the cart.

Your Session Has Expired in Magento 2


UPDATE core_config_data SET value = '' WHERE core_config_data.path = 'web/unsecure/base_url';

UPDATE core_config_data SET value = '' WHERE core_config_data.path = 'web/secure/base_url';


Website URL: http://localhost/magento/

Replace with

Website URL:

Core Config Data Magento 2

Read more: How to Install Magento 2.3 on XAMPP Server in Windows


Now Run the command:

php bin/magento cache:flush

php bin/magento cache:flush

That’s it.

Now your error has been solved, you don't need to do anything now.


Similar Post:

Magento 2.4 Installation Guide: How to Install Magento 2.4.2