-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create private content version cookie when required #6406
Create private content version cookie when required #6406
Conversation
…AX fetch private block content. Current behaviour dictates that only POST requests will generate the cookie, leaving sessions initially lacking it and causing private content to remain unloaded. See also: issue #3890.
What's the status on this? |
AFAIK no action has been taken and this issue is still not addressed in the current develop branch. |
@moloughlin correct me if I'm wrong but this wouldn't work with Varnish would it. I mean a user being served a cached page will never be able to have the cookie set right? It looks like the built in FPC will set the cookie so this will work under those circumstances but I feel like it may also require a change in the JS to ensure customers receiving a cached page from Varnish still load the data. Note: I've not actually tested this with Varnish, it's just a hunch |
@mikeymike it should work because same code is executed for the Varnish in the \Magento\PageCache\Model\App\FrontController\VarnishPlugin::afterDispatch |
@moloughlin can you please fix Travis failures? I.e.
|
Closing doe to inactivity |
[Arrows] Fixes for 2.4 (pr112) (2.4-develop)
The private-content-version cookie is required for the front-end JS to AJAX fetch private block content. Relevant JS snippet from page-cache.js:95:
Current behaviour dictates that only POST requests will generate the cookie, leaving sessions initially lacking it and causing private content to remain unloaded. See issue #3890 for one case where this is causing problems, I've added some steps to reproduce as a comment
Note: This change conforms with the function's phpdoc (see below), which up until now has not been true. "Set cookie if it is not set" was never implemented but clearly was part of the intended design.