Symfony 7.2 introduced the concept of "stateless" CSRF tokens. This system is very appealing, but it comes with two requirements:
- in production, we must be sure that the
Origin and Referer headers are correctly set (because they are probably not forwarded from the reverse proxy)
- as the CSRF verification requires some JavaScript, we'll probably have to write some code to get the CSRF token
The existing system works well so we have no plan to migrate soon. However, this new system could improve the UX as the users shouldn't face the "The CSRF token is invalid" error anymore.
References:
Symfony 7.2 introduced the concept of "stateless" CSRF tokens. This system is very appealing, but it comes with two requirements:
OriginandRefererheaders are correctly set (because they are probably not forwarded from the reverse proxy)The existing system works well so we have no plan to migrate soon. However, this new system could improve the UX as the users shouldn't face the "The CSRF token is invalid" error anymore.
References: