#30272Form protection: Do not save flash messages in session during an Ajax request
Description
Problem:
If form token validation fails in the backend, a flash message is created and stored in the session.
This is not desired during an Ajax request, because then the flash message is rendered out of context the next time the flash message queue is flushed
Solution:
Do not persist flash messages in the session if we are in an Ajax context.