Description
Essentially, users carts will disappear or they won't be able to login, or they'll be logged out or some other session related wackyiness.
creating here from #7931 as @orlangur said to make a new one
There are multiple reasons why this is occurring -- the follow is the first way I've found to recreate an a problem easily.
Preconditions
- magento 2.2.0 + (updated)
- customers who want to buy things
Steps to reproduce
One way to reproduce is:
- install firefox;
- disable localstorage in firefox (about:config dom.storage.enabled == false);
- browse around the catalog;
- while on a product listing page, identify a product that really is interesting;
- open the product detail page in a new window/tab;
- decide the product isn't for you and close the product detail window/tab;
- browse around some more;
- on a product listing page identify a product you'd like to know more about;
- open the product detail page in a new tab/window;
- decide you don't want it and close the tab/window;
- do this eight more times until you find a product you want;
- try to log in or add it to your cart;
- try to checkout;
- look for your cart;
- look at your cookies and see billions (exaggeration) of them.
- look at your magento log and see maximum cookies error
Expected result
- customers are happy and can buy stuff
- clients make money
- cookies minimal
Actual result
-
customers are unhappy
-
clients are really unhappy
-
cookies are a sogging mess
depending on surfing habits there will be multiple ss_\d{8}* named cookies and multiple ls* cookies, possibly far too many depending on a variety of normal operating conditions. -
possibly get a "too many cookies" error
-
possibly get a "request header too large" error
changing
https://github.com/julien-maurel/jQuery-Storage-API/blob/d2ce10b0fb53d7cb919f14e70853a5c232477f93/jquery.storageapi.js#L423
to be a static string instead of a random number for the window.name helps with the ss_* cookies
it will not help with the ls_* cookies
again, disabling localstorage here in firefox is just one example of causing the issue