When i try to login to admin panel, there is no error, just redirection again to login page. I cleared my cookies, tried different browser and checked my cookie domain settings in db - they are set correctly. Redirection happens beside if i provide correct or incorrect login information.

Site was working on 2.3.6 - after upgrading to 2.4.3-p1 this issue occurs. This is happening on Windows with xampp - i have second machine with linux that is working perfectly fine after upgrade. Front is working fine on Windows.

  • I think magento is not meant to work with windows you might have some issues with that. Also; check if your base url are correct. And check if you don't have some kind of captcha preventing the submit.
    – Claims
    Commented Nov 12, 2021 at 16:37
  • There is no captcha and base url is correct, as frontend is working perfectly fine. It was working fully on windows with 2.3, slow but working
    – Kizbo
    Commented Nov 12, 2021 at 18:24
  • I mean, you should have base url for the front side, which might be good, but also a secure base url for the admin. Though I still think there might be issue due to windows, from the doc we can read : Operating systems (Linux x86-64) Linux distributions, such as RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, and similar. Magento is not supported on Microsoft Windows and macOS.
    – Claims
    Commented Nov 13, 2021 at 1:03
  • I'm too starting to believe that this might be problem with Windows on newer version of Magento. Strangely enough my coworkers use Windows to develop with no problem like this - i even copied my files and db to another pc and it works on Windows as expected (slow, but working). I've got base url for the admin set.
    – Kizbo
    Commented Nov 13, 2021 at 22:40

5 Answers 5


php bin/magento config:set system/security/max_session_size_admin 2560000

php bin/magento c:f

Then check it's working for me.

It's right because

I Found the same issue! In Magento 2.4.5-p1 it seems that a value of "0" for "Max Session Size in Admin" breaks it. In normal behaviour "0" should disable the size. I set mine now to "2560000" cause the default setting of "256000" isn't working for us (too low) and that solved this issue for now.

You can set it to this value through CLI (flush cache after):

bin/magento config:set system/security/max_session_size_admin 2560000
  • Thanks! Worked like a charm.
    – Sondre
    Commented Feb 6, 2023 at 12:51
  • This worked for me, thank you Commented Feb 9, 2023 at 21:13

Please Change http:// to https:// or if you are working in local then change localhost to


Actually it was a problem with upgrade from 2.3.6 to 2.4.3 - magento added 2FA to login in 2.4 and on my Windows installation, for some reason, instead of showing error informing me that i need to configure 2FA to login, it just reloaded login form without any notice or errors.

Disabling 2FA module in my local enviroment solved the issue.

How to disable Two factor Authentication module in Magento 2.4


Did you try to remove cookie config from databases?

enter image description here

or try with another browser, example firefox.

Hope it help!


I had this happen even after disabling the 2FA module as suggested by the accepted answer. I looked in var/log/system.log and found on my localhost that my issue was due to session size being set as lower than the actual session size I needed. I went to advanced -> system -> security, set it to a round up to the nearest 10,000 of the number given there and that sorted the issue for me.

  • 1
    Add extension=sodium to php.ini If already added, make sure it is not commented if so uncomment it Restart Server Commented Jan 9, 2023 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.