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.
Solution:
UPDATE core_config_data SET value = 'http://127.0.0.1/magento/' WHERE core_config_data.path = 'web/unsecure/base_url'; UPDATE core_config_data SET value = 'http://127.0.0.1/magento/' WHERE core_config_data.path = 'web/secure/base_url';
Note:
Website URL: http://localhost/magento/
Replace with
Website URL: http://127.0.0.1/magento/
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