Magento Backend (Admin panel) - Can Not Log-In

0

You followed each step from downloading up to creating your admin account but you are not able to login to your Magento store backend. You are inputting the login/password, but nothing happens, or even worse, it displays “Access denied”, while you are pretty sure that it has been working and nothing has been changed.

One usually meets one of two variants of this problem:

1.      While trying to login, you get no errors apart from the same invitation page repeatedly.

When confronted with this problem, check that you have correct cookie domain set up.

As soon as you can not access Magento backend at the moment, it is best done via mysql query:

mysql> select * from core_config_data where path like '%cook%';

+-----------+---------+----------+----------------------------------+----------------------+

| config_id | scope | scope_id | path | value |

+-----------+---------+----------+----------------------------------+----------------------+

| 594 | default | 0 | web/default/cms_no_cookies | enable-cookies |

| 597 | default | 0 | web/cookie/cookie_lifetime | 0 |

| 598 | default | 0 | web/cookie/cookie_path | NULL |

| 599 | default | 0 | web/cookie/cookie_domain | yoursitedev.com |

| 600 | default | 0 | web/cookie/cookie_httponly | 1 |

| 601 | default | 0 | web/cookie/cookie_restriction | 0 |

| 607 | default | 0 | web/browser_capabilities/cookies | 1 |

+-----------+---------+----------+----------------------------------+----------------------+

7 rows in set (0.01 sec)

If you see that cookie domain is not the one you are using to access your store, update it via the following query:

mysql> update core_config_data set value='yoursite.com' where config_id=599;

Change “yoursite.com” as appropriate of course.

2.      You can get “Access denied please try to logout and sign in again” although you are sure that credentials are correct.

In this case, you may have contravened “Administrators” role, which is used by admin user account.

Use the script when you follow the link https://gist.github.com/mapav/7464484 for your solution.

You should uncomment and modify USERNAME, EMAIL and PASWORD variables (see script for detailed instructions) and save modified content at the root Magento folder as a new file, for instance, /correctadmin.php. After saving, open browser and follow the link http://yoursite.com/correctadmin.php.

You will have a new user and new role created with admin privileges and you will be able to log in to Magento admin and try to fix ‘Administrators’ role.

Hope this was useful for you!