Description
Whenever there are multiple tabs open and there are POST requests being executed on both, one of the page faces CSRF validation due to deletion of token assuming that the old tokens are consumed.
Consider the below scenario in order given,
Tab 1 : I have a page A which loads
and there is a post ajax call on load to load certain section on the page A.
Tab 2 : I open another page B and navigate to a page C which has a form to post.
Tab 1 : I fill up a form on the page A, that causes a re-trigger of the ajax call on the page A to reload a section.
Tab 2 : I submit a form on Page C.
My submit request is blocked by the csrf protector giving 403.
My application has ajax post calls and form posts which get executed on multiple tabs.
In such a case the old csrf token gets deleted causing error for genuine requests by the user.
How do I solve this issue?