2

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?

2
  • I have no idea, what this is or what it restricts, but from my point you are correct with notices.phtml and ga.phtml Commented Feb 14, 2014 at 7:50
  • When enabled it displays the following "This website requires cookies to provide all of its features. For more information on what data is contained in the cookies, please see our ...." and a button to Allow cookies. (if it was working correctly you should only get a cookie after clicking Allow). Commented Feb 14, 2014 at 10:19

2 Answers 2

2

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.

3

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.

1
  • Thanks for your reply - I guess it confirms my suspicions that this is an omission by Magento and adding this warning was the easy way out. Commented Feb 17, 2014 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.