Skip to content

Magento2.4.7: How to Clear/Delete outdated Cookies?

Problem:

We have discovered that when we start getting a large amount of cookies/data, users are getting errors or undesired issues or, in some cases, getting a 400 error.

We need to implement some code that forcibly dumps the user’s on-site cookies. This can be after X days/hours, X number of visits, or when it gets to a certain MB.