The new module at https://www.drupal.org/project/cacheable_cookie_handling provides a framework for handling cookies similar to the cookie this module sets.
It would be useful to integrate with that, since it results in fewer Ajax requests on sites that also use that module for other purposes (one consolidated Ajax request to set a variety of cookies, rather than the Cacheable CSRF module doing its own custom Ajax request for the same purpose).
It's possible to integrate with that module without requiring it, however making it a strict dependency simplifies the code, and also automatically fixes #2786659: Prevent multiple Ajax requests from firing at once. So for now this patch makes it a strict requirement.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2789019-use-cacheable-cookie-handling-7.patch | 3.41 KB | hadsie |
#2 | 2789019-use-cacheable-cookie-handling-2.patch | 3.41 KB | David_Rothstein |
Comments
Comment #2
David_Rothstein CreditAttribution: David_Rothstein at Tag1 Consulting commentedHere is a patch.
Comment #3
David_Rothstein CreditAttribution: David_Rothstein at Tag1 Consulting commentedWith this patch we aren't checking "access content" anymore. We could do it manually in the new hook (before setting the cookie) but I didn't see any obvious reason this permission check was needed in the first place? (Seems like it should be theoretically possible to deliberately use this module with users who can't access content, if you want to...)
This is removed in the patch (and is not something that the Cacheable Cookie Handling module does in its Ajax callback). However since in practice the Ajax callback is called via POST, it shouldn't matter?
If it's needed after all for some reason, we can do a separate patch for Cacheable Cookie Handling that adds these headers there.
Comment #4
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedRTBC - the integration looks good to me.
Comment #5
marco CreditAttribution: marco at Tag1 Consulting commentedrerolled.
Comment #6
marco CreditAttribution: marco at Tag1 Consulting commentedre-rerolled.
Comment #7
hadsie CreditAttribution: hadsie at Tag1 Consulting commentedreroll of Marco's patch attached.
Comment #9
douggreen CreditAttribution: douggreen at Tag1 Consulting commented