Magento – Magento admin login and logout issue

magento-1.8

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??

Update

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/

Best Answer

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.

Related Topic