I have installed Magento 2 latest version on my local xampp. Application is loading fine but the login on both frontend and backend is not working.

As per googling results I have made below changes,

  1. Changing localhost into
  2. Changing into www.mysite-magento.com by modifying the hosts file in windows/system32 and httpd.vhost.conf on xampp server. Application loads as usual but login no luck.
  3. Added cookie_domain in core_config_data table as mysite-magento.com
  4. Changed max_input_vars, max_input_time and max_execution_time as 100000, 600 and 3600 respectively.

When I try creating an account, the error message is showing as

Invalid form key

When I try to login backend, no error message or log but login is not working.

These are the suggestions given in the forums None of them seems to be working. Any work around?

1 Answer 1


Are you facing issues in the Backend or frontend login or both?

If its backend Invalid form key, then steps to reproduce

1: Unlock the Magento admin user, and run the command:

php bin/magento admin:user:unlock username

2: Run the cache command to clear the cache

3: If its localhost set the Base URL accordingly as http://localhost or

4: Check if any external third-party extension that may create conflict after logging in. Please check the redirect URL if it's redirecting to any URL or check the logs when trying to log in.

5: You may be trying to reach the backend with the wrong URL. Check the correct URL for the admin panel through the following command:

php bin/magento info:adminuri

6: If possible, please share the URL of your application if all other pages, like category, are working.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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