3

I've started out with Magento 2. Everything's working fine, except for Magento's formKeyValidator which isn't able to validate the incoming request. It's happening on the frontend.

While adding a product to the cart or creating an account. This isn't passing::

// module-checkout/Controller/Cart/Add.php - function execute()
$this->_formKeyValidator->validate($this->getRequest())

I've increased the cookie lifetime, set the valid domain, and path ( http://localhost/mysite, domain:localhost, path:/mysite ) from the backend config panel, yet for some reason I keep getting this:

"Your session has expired"

9

Yes, use 127.0.0.1 instead of localhost.

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';
  • Thanks. I actually solved it the same day when I fist posted it. This answer might help others. – keaton016 Jan 29 at 16:27
  • I tried but not working. – sarvesh Dineshkumar Patel Jul 16 at 11:22
2

Step 1: Disable the cache
Steps 2: Run below two lines of Mysql code

UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/yourmagentofolder/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/yourmagentofolder/' WHERE `core_config_data`.`path` = 'web/secure/base_url';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.