Magento – Unable to send the cookie. Maximum number of cookies would be exceeded Magento 2.1.5

cookiemagento2

Every time I open var/Repots in magento 2 website, I found hundreds and thousands of error files all having the same message:

a:4:{i:0;s:71:"Unable to send the cookie. Maximum number of cookies would be exceeded.";
i:1;s:12555:"#0 /home/domain/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(116): Magento\Framework\Stdlib\Cookie\PhpCookieManager->checkAbilityToSendCookie('form_key', '........')...

I searched a lot, but I did not find a solution. The maximum number of cookies is set to 50 by default.

The problem is not happening on my browser. It mostly happens with customers using android mobile phone's browser Android Version 4.0.2 to 4.4.0.

Clearing cache or using private browsing solves the issue on the client side. However I need a server side solution. (I asked a customer to clear the cache and the problem is solved on his mobile).

Best Answer

This article should help give you a better idea on the Root Cause (i.e. how/what/why) of the issue - https://mage2.pro/t/topic/84/2

Unfortunately, it doesn't look like Magento is in any hurry to fix the issue for Android OS based browsers - https://github.com/magento/magento2/issues/7931