Fix Magento 2 Admin Login Page Reloading Issue on Windows
The Magento 2 admin login page reloading issue occurs when the admin login page keeps refreshing after clicking Sign In, even though the username and password are correct.
This problem is commonly reported on local Windows environments, especially when running Magento 2 on XAMPP. In many cases, the issue is caused by a corrupted auto-generated metadata file rather than cache, cookies, or compilation commands.
Symptoms

- Magento 2 Admin login page reloads continuously
- No error message is displayed
- Correct admin credentials do not work
- Mostly happens on:
- Windows
- XAMPP
- Local development environments
Root Cause
Magento automatically generates metadata files used internally by the framework.
On some Windows-based environments, one of these files may become corrupted or incompatible.
The most common file causing this issue is:
generated/metadata/global.php
When this file is invalid, Magento fails to complete the admin login process, resulting in the login page reloading repeatedly.
Solution: Delete the Generated Metadata File To Fix Magento 2 Admin Login Page Reloading
This is the primary and most effective solution for this issue.
Step 1: Locate the Metadata File
Navigate to your Magento root directory:
{Magento_root_directory}
└── generated
└── metadata
└── global.php
Step 2: Delete global.php
Delete the following file:
generated/metadata/global.php
Notes:
- This file is auto-generated by Magento
- It is safe to delete
- Magento will recreate it automatically when needed
Step 3: Log In Again
- Reload the Magento Admin login page
- Enter your existing admin credentials
- You should now be logged in successfully
No additional commands or configuration changes are required.
Why This Fix Works
- Removes corrupted metadata that interferes with admin session initialization
- Forces Magento to regenerate metadata cleanly
- Resolves admin login reload loops on Windows environments
This fix is especially effective for Magento 2.4.x running on XAMPP.
Conclusion
If your Magento 2 admin login page keeps reloading on Windows, deleting the generated/metadata/global.php file is the fastest and most reliable solution. This issue is not related to dependency injection compilation or cache configuration and can be resolved in seconds.