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/session
directory
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
Your entire /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 /var/session
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
TBC
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.
I have had this on and off for a while, worse in IE11, could get in via mozzilla, had server guys, developers look into this and nothing resolved it finally managed to resolve it today for IE11, noticed that the only cookies being created were in Internet Explorer (protected mode) so turned off protected mode and logged straight into admin section, been at this for months now and glad I figured it out
Hey Mark, thanks for sharing your experience.
This issue is usually something that can be resolved locally (i.e. in browser) rather than within Magento itself. There are tons of reasons this could occur though hence the ‘TBC’ at the end of the post as I do plan to expand it to include a whole load more things to check.
I try not to use IE unless I’m held at gunpoint (in other words, cross browser testing a site we’re working on) but one of the best ways to test this is to load up a private browsing session and then try to log in to your Magento admin.
If this works without issue, you know the problem is due to cookie/cache storage locally and saves you going any further debugging in Magento.
Thanks for stopping by to leave a comment detailing your scenario.