Login redirect when trying to login to Commerce Admin
This article gives the possible solutions for the Commerce Admin login issue, where you are redirected back to the login form when trying to log in to the Admin, and no error message is displayed. These include correcting the server timezone settings and clearing the cookies settings in Adobe Commerce.
Affected editions and versions:
All Adobe Commerce versions and editions.
Issue
Steps to reproduce:
- Go to your Commerce Admin page.
- Enter your credentials and click Sign in.
Expected results:
You get logged in to the Commerce Admin.
Actual results:
You are redirected back to the login form with no error messages.
Cause
There are a couple of possible reasons for the issue:
- Incorrect timezone set on browser level (which leads to the admin session being considered expired even if its actual lifetime hasn’t yet expired).
- Incorrect cookies settings, which leads to the established session not being used by Adobe Commerce.
See the next paragraphs for solutions in each case.
Solutions
Admin session lifetime issue
Try to use a different browser and increase the admin session lifetime if it is less than one hour.
To increase the admin session lifetime, take the following steps:
-
Create a database backup.
-
Use a database tool such as phpMyAdmin, or access the DB manually from the command line to run the following SQL query:
code language-sql UPDATE core_config_data SET value = 7200 WHERE path = 'admin/security/session_lifetime';
-
Clean the configuration cache by running the following command:
code language-bash php <your_magento_install_dir>/bin/magento cache:clean config
Incorrect cookies settings
To check the cookies settings values and clear them, take the following steps:
-
Create a database backup.
-
Use a database tool such as phpMyAdmin, or access the DB manually from the command line to run the following SQL query:
code language-sql SELECT * FROM core_config_data WHERE (path = "web/cookie/cookie_domain" OR path = "web/cookie/cookie_path");
-
If the values’ responses are not empty, set them to NULL by running:
code language-sql UPDATE core_config_data SET value = NULL WHERE (path = "web/cookie/cookie_domain" OR path = "web/cookie/cookie_path");
-
Clean the configuration cache by running the following command:
code language-bash php <your_magento_install_dir>/bin/magento cache:clean config
Related articles
- Redirect back to the Admin login form with “Your account is temporarily disabled” error in our support knowledge base.
- Redirect back to the Admin login form with “Your current session has been expired” error in our support knowledge base.