Closed
Description
Previously this issue was reported in #7931 and #16568, but no one was able to reproduce it.
Preconditions
- Magento 2.2.5 installed via composer
Steps to reproduce
- Open desktop browser Firefox
- Navigate to
about:config
- Find "dom.storage.enabled" option and change to "false"
- Navigate to Magento 2.2.5 (frontend), open developer tools >> Storage >> Cookies and look at list (there are 33 cookies)
- Duplicate tab (open the same page in another page) - you will have 43 cookies.
- Try to duplicate tab again - you will have 52 cookies.
Expected result
- Cookies list should not grow such fast
Actual result
- We can take more then 50 cookies that leads to exception that described in Unable to send the cookie. Maximum number of cookies would be exceeded #7931 and local/session storage is mismanaged, particularly when it doesn't exist #16568
Tech note
I investigated issue described in #16568 and found that we have 2 different polyfill implementaions for localStorage and sessionStorage:
- Added to page html (https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml)
- As part of jquery.storageapi library - https://github.com/magento/magento2/blob/2.2-develop/lib/web/jquery/jquery.storageapi.min.js
These implementation are fully different. 1st one works good, but 2nd one adds strange behavior - adds separate cookie with ls_
prefix in name for each item that should be stored in localstorage and ss_<some_id>_
for session storage. As result - when customer goes through website - it will add new and new cookies (because of this strange ss_<some_id>_
prefix).
Sometimess, we're having 2nd implementation used instead of 1st one.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 releaseAffects aesthetics, professional look and feel, “quality” or “usability”.