when I tried to login into Magento admin it's show me error Invalid Form Key. Please refresh the page. and I know I am entering correct username and password. when I tried second time to login with same user name and password it's allow me to login successfully.

after 2 try finally I login to my Magento admin panel but after that when I click on logout it's refresh page and redirect me to dashboard.it's not logout from Magento admin panel.

any idea??


now if I try to login in admin it's doesn't show any error it just refresh and url is changed.

for ex : my admin url is : example.com/admin username : admin password : admin@123

now if I try to login using this details page is refresh and my url is change from example.com/admin to example.com/admin/index/index/key/95fdcbe3f6af413384d42ea557a7b4e7/

2 Answers 2


At Admin->Configuration->Web->Session Cookie Management set the "Cookie Path" to "/" and Cookie Domain: .site.com ,clear the browser cache and try again. IF you can't login into the admin area, you can check it directly via mysql:

SELECT * FROM core_config_data WHERE path LIKE '%cookie_domain%';

You can change the value in mysql directly as well. Don't forget to clear the cache afterwards.

  • in which table magento store Cookie Path and Cookie Domain becuase after use your solution I am not able to login into admin.
    – Dhaval
    Jun 8, 2016 at 6:49
  • see updated answer
    – Arunendra
    Jun 8, 2016 at 7:01

Its look like your browser cache problem, did you try to clear your browser cache ? Please clear your browser cache or try to login with another browser.


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.