What is the prefered way to deal with cached forms and CSRF token? Here they propose a JS overwrite of input attribute, but I also want to cache the header.
Here is an article describing different methods: http://www.fastly.com/blog/Caching-the-Uncacheable-CSRF-security/.
A short summary:
My take:
You need to set up special infrastructure for using ESI, so I do not like that solution. AJAX requests are slow and a lot of network overhead, so I do not like that solution as well... So I would go with the cookie solution or with the JS solution you already mentioned, since these are the simplest solutions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With