CSRF-Protector-PHP icon indicating copy to clipboard operation
CSRF-Protector-PHP copied to clipboard

Issue with multiple tabs with POST ajax requests

Open srishti-chouksey opened this issue 6 years ago • 7 comments

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?

srishti-chouksey avatar May 28 '19 07:05 srishti-chouksey

@mebjas, can you please have a look, thanks.

srishti-chouksey avatar May 28 '19 07:05 srishti-chouksey

@mebjas : Do we have any update on this?

bhavinrshah avatar Jun 04 '19 06:06 bhavinrshah

@mebjas, did you get a chance to take a look at this?

srishti-chouksey avatar Jun 14 '19 07:06 srishti-chouksey

I have setup a branch to reproduce this issue. If you have a setup online that can reproduce this issue, please point me to that. @srishti-chouksey @bhavinrshah

mebjas avatar Jul 21 '19 10:07 mebjas

We don't have setup online. Have you checked the issue?

bhavinrshah avatar Nov 14 '19 10:11 bhavinrshah

I have not been able to reproduce this yet. Is this still a problem?

mebjas avatar May 23 '20 12:05 mebjas

What happened to this?

CassadyCampos avatar May 02 '23 21:05 CassadyCampos