I have set staging database to local setup. Frontend is working good.

For backend after login dashboard url is shoiwng http:// xyz . com / admin/admin/dashboard/index/key/9fea02870e23e77980f350eb2b73889e0bdb04239781c66e533e065dcf19ed98/

with login form. enter image description here

I have run all commands and not showing any error in log files. I have also try to create new admin user, new admin user is also not able to see dashboard page, same login form is shoiwng after login form submit.

  • Need to run this command: bin/magento config:set system/security/max_session_size_admin 2560000 Jun 7, 2022 at 13:10

4 Answers 4


What worked for me was to set max_session_size_admin

magento config:set system/security/max_session_size_admin 1024000
magento cache:clean config

Magento 2.4.5


Please refer to this link maybe its helpful for you Login redirect when trying to login to Commerce Admin

Moreover Check either your Magento Version is compatible with your php version.

  • not working....... Jun 7, 2022 at 11:21
  • Your's Magento version and php version ? Jun 7, 2022 at 11:26
  • M2.4.4, php 8.1 Jun 7, 2022 at 11:33
  • have you try it on some other browser ? e.g. FireFox, maybe having some cookies issue Jun 7, 2022 at 11:47
  • yes, issue with .domain Jun 7, 2022 at 12:10

I have faced the same issue in the local, while setting up Magento 2.4.4 and that's also in windows system. I have figured out the issue by this way.

Add extra code in the below file Path:- \vendor\magento\framework\View\Element\Template\File\Validator.php

     * Checks whether path related to the directory
     * @param string $path
     * @param string|array $directories
     * @return bool
    protected function isPathInDirectories($path, $directories)
        if (!is_array($directories)) {
            $directories = (array)$directories;
        $realPath = $this->fileDriver->getRealPath($path);
        //Start Extra Code
        $realPath = str_replace('\\', '/', $realPath);   
        //End Extra Code
        foreach ($directories as $directory) {
            if (0 === strpos($realPath, $directory)) {
                return true;
        return false;

After adding this run deploy command and remove files from var and generated folder.

php bin/magento s:d:com


I experienced the same issue on magento 2.4.6. For other test purpose i setted web/cookie/cookie_domain to .example.com. Reverted to example.com it returns to work correctly.

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.