Cookie Restriction Mode on EE
-
16-10-2019 - |
Question
The setting System > Configuration > Web > Session Cookie Management> Cookie Restriction Mode
comes with the following warning on Enterprise:
Note that to fully restrict cookies, full page caching must be disabled as well.
Questions:
Turning FPC off is quite a penalty for this feature - were they just too lazy to implement placeholders or are there any other valid reasons for this?
I have found notices.phtml and ga.phtml that rely on the cookie acceptance - any others?
Solution
If i remember correctly the problem is FPC uses cookies that hold tracking information like name or cart contents. If you disable them, FPC does not work.
OTHER TIPS
The problem is that, if you allow it, a cookie is saved and the shop is allowed to use Google Analytics (ga.phtml) etc. Unfortunately the FPC might cache blocks which use cookies so it can't be evaluated if you allowed the cookie or not. Therefore the first hit on a page decides if everyone allows cookies or noone allows cookies.
To solve this issue you probably need to punchhole at least notices.phtml and ga.phtml, probably more, to load them dynamically "thru" the FPC if cookies are allowed.
I guess Magento just can't handle it out of the box, so you probably need some more extensions.
One idea is to add both blocks always, but as a string in JavaScript (so it's not actually executed). Then use JavaScript to read the user_allowed_save_cookie
cookie and parse the contained JSON data and decide if the blocks should be added to the homepage.
You can find more information about this cookie in the Mage_Core_Helper_Cookie
class.