Unable to Log in to Magento Admin as Page Refreshes
If you run a Magento store, then you will undoubtedly experience this issue at some point which will randomly crop up out of nowhere. One day, you attempt to log in to your Magento admin panel and instead of being presented with the dashboard (or a specified page of your choice), the page will just refresh (redirect back) and you’re still just presented with the login username and password fields.
There are a number of reasons why this may happen, but it will usually be down to a cookie mismatch. The first steps to take to try and see if they resolve the problem for you are as follows:-
Clear your browser cookies
You only need to delete the stored cookie for your website but not all browsers will allow you to selectively delete individual cookies, you might find (like in Google Chrome), that you have to delete all in one go. The method to delete your browser cookies will depend on the browser you are using but you can visit this page if you need step by step instructions to do this.
Still didn’t resolve the problem?
Now usually, deleting your browser cookies will resolve the problem and you’ll find that you’ll be able to log in to your Magento admin successfully next time. If however, that didn’t work, the next steps to try in this order, are as follows:-
Check the permissions on the
/var/sessions directory needs to be writeable in order for Magento to store the sessions. If it isn’t, you can run the following from your Magento root with SSH access:-
chmod -R 777 var/session
/var directory should be writeable really (unless there is something stored in there that you wouldn’t want to be changed should your Magento store be hacked, but this shouldn’t be the place to keep anything like that).
chmod -R 777 var/
Clear the stored Magento sessions from
You can delete the sessions directory itself as it will be recreated again as soon as there is a session to store (run from Magento root):-
rm -rf var/session
We will continue to add to this post so please feel free to leave a comment if the above didn’t fix this issue for you.