In your Magento 2 journey, you might have greeted with this error message – “Your session has expired”, when clicking on the add to cart button.
This is usually happen when you install Magento in your machine and give the url as localhost.
To resolve the issue you can change the unsecure/secure baseurl to 127.0.0.1 in your Magento 2 installation.
Open your database in your favorite tool like phpmyadmin and run the below MySql query.
UPDATE core_config_data SET value = 'http://127.0.0.1/magento2/' WHERE core_config_data.path = 'web/unsecure/base_url'; UPDATE core_config_data SET value = 'http://127.0.0.1/magento2/' WHERE core_config_data.path = 'web/secure/base_url';
And clear your cache, you will see the error is gone.
php bin/magento cache:flush
Did this post help you?
Tutsplanet brings in-depth and easy tutorials to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
- Just want to thank us? Buy us a Coffee
- May be another day? Shop on Amazon using our links.
Your prices won't change but we get a small commission.
Leave a Reply