Magento2 Admin login not working

Generally, we faced one issue on creating a clone of our any production site or staging server. The issue is that after setup the project, we are unable to login to admin while we enter the correct username and password.

To fix this issue, follow the steps:

  1. Go to PhpMyadmin
  2. Open table core_config_data
  3. Run this command: SELECT * FROM core_config_data WHERE path LIKE '%cookie%'
  4. Change the value for the row which path is “web/cookie/cookie_domain”
  5. For my setup, I setup shailesh.test.com If you have local setup then you can setup localhost or respective local URL name.

Like

Do not forget to run the commands below:

  1. rm -rf var/*
  2. rm -rf generated/*

--

--