After manually removing some files into pub/static/frontend (because the cache wasn't cleaning properly, neither with bin/magento cache:clean/flush nor from the backoffice) and then cleaning and flushing the cache from CLI I got a blank page without errors when trying to load my Magento e-commerce or the backoffice. I solved the ecommerce problem with

  • bin/magento setup:di:compile
  • php bin/magento deploy:mode:set developer
  • bin/magento setup:static-content:deploy -f
  • bin/magento cache:clean
  • bin/magento cache:flush

But now for what concerns the backoffice, every time I try to load the admin uri it says:

Exception #0 (ReflectionException): Impossible to process constructor argument Parameter #1 [ <required> Magento\Framework\Stdlib\Cookie\PublicCookieMetadataFactory $cookieMetadataFactory ] of Magento\Security\Model\SecurityCookie class
Exception #1 (ReflectionException): Class Magento\Framework\Stdlib\Cookie\PublicCookieMetadataFactory does not exist

I tried to understand what it is but I can't figure it out...

Magento version: 2.4.4 Server distro: Ubuntu 20.04 PHP: 7.4

  • Try to disable all third extensions first and then check by enabling one by one. So you get idea if that occurs from any party extension or not. Mar 25, 2023 at 11:21
  • I don't know what it was exactly but somehow I solved it: I wanted to do some tests without breaking more stuff, so I decided to clone everything on another server to make my tests. I dumped the DB, changed the IPs in core_config_data and uploaded it on the other server, I copied the entire Magento root folder, pasted it on the server and changed the DB data in env.php. On the new server I compiled the DI, set developer mode and re-deployed static-content. Everything was working good. It's not an effective solution to the problem (so I'm not posting this as an answer) but it solved my problem.
    – mugnozzo
    Mar 27, 2023 at 7:50

1 Answer 1


Having this problem multiple times and doing some tentatives I finally came to a solution.

The problem comes when I delete some of the files generated by magento and I'm logged-in in the backoffice.

When I try to refresh the backoffice page I get the error.

Solution (simpler than I thought) If I clean the cookies and website data in the browser the problem is solved.

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.