My repeated Ajax call deletes session flash data
I have a Javascript to make an Ajax call it calls my api every 5 seconds to update my user page.
I am returning a view with flash data which it has to keep for the next request but the Ajax call clears it and the next request is not completed.
Is there a way to complete it?
I can think to re-flash on an api call, but that seems weird. Any other way?