We have a Symfony 4.3 app which has a page which makes multiple AJAX requests. Each AJAX response contains a few forms and each form has its own CSRF token. However, only one of the AJAX calls manages to store it's token in the session. Therefore all forms in the AJAX requests will fail with the message
The CSRF token is invalid. Please try to resubmit the form.
Except for one form which manages to have its token saved correctly in the session.
The session is stored in redis.
How can I make sure all CSRF tokens are stored in the session when making multiple AJAX calls?