Can't login to Magento admin

Can't login to Magento admin

July 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Can't login to Magento admin

Can’t Login to Magento Admin? Here’s How to Fix It

Are you facing issues logging into your Magento admin panel that was previously working fine? Don’t worry—you’re not alone. This common problem can be caused by several factors, but we’ll guide you through the most effective solutions to get your Magento store up and running again.

The Situation

You have installed Magento in a subdirectory: www.domain.com/subdir/magento. The site was working perfectly until your client reported they couldn’t log into the admin panel. When you tried from your own computer, the login worked fine, but on their machine, it just redirected back to the login screen without an error message.

The URL looked something like this:

http://domain.com/subdir/magento/index.php/admin/index/index/key/3097210b826ac4a86d7531cb4089c9d0/

Potential Causes

This issue could be due to several reasons, such as cookie settings, cache files, or even changes in your server environment. Let’s explore the most common culprits and their solutions.

Solution 1: Check Your Magento Base URLs Settings

First, ensure that your Magento base URLs are set correctly under System > Configuration > General > Web. The secure and unsecure base URLs should be:

http://domain.com/subdir/magento/

Pay close attention to the trailing slash. If it’s missing or incorrect, update it accordingly.

Solution 2: Clear Cache Files

Sometimes, cache files can cause unexpected behavior in Magento. To clear them, delete everything inside your var/cache and var/session folders. Make sure you have a backup of any important data before proceeding.

Solution 3: Review Your Cookie Settings

If the above steps don’t work, examine your cookie settings in System > Configuration > General > Web. The web cookie path and domain should be set as follows:

Path: /subdir/magento
Domain: subdomain.domain.com

Replace subdomain with your actual subdomain. If you haven’t configured a subdomain for your Magento installation, leave the domain field blank.

Solution 4: Check .htaccess File

Sometimes, the .htaccess file can cause redirection issues if it’s not properly configured. Ensure that there are no unexpected redirects or rules that might be interfering with the login process.

Conclusion

Remember, when dealing with complex platforms like Magento, small changes can sometimes have significant consequences. Always make sure to test your modifications thoroughly and keep backups of important files before making any adjustments.

If none of the above solutions work, it’s a good idea to contact professional Magento developers for assistance. They can provide more in-depth analysis and tailored solutions specific to your store setup.

For further reading on Magento optimization and troubleshooting best practices, visit our blog at LaravelCompany. We regularly publish articles on Magento development, performance tuning, and security enhancements to help you make the most of this powerful e-commerce platform.

Cache Admin Configuration Errors

Our network