Welcome Guest, Not a member yet? Register   Sign In
CSRF regenerate with AJAX
#5

(This post was last modified: 04-15-2020, 12:11 PM by Gary.)

That looks, and sounds like it's ok...

My only additional observaton is that if all the submissions are done using ajax (which may be the case, seeing: $(form).serializeArray() in your code), then sticking copies of the same token in every form is wasteful in terms of processing time and effort - having the token as an ajax global, or if you really want it stuck into the DOM, having a single copy of it inserted (somewhere close to the top of the document) that is then extracted (and appended to the next post) by the ajax submission call would seem more efficient.
Reply


Messages In This Thread
CSRF regenerate with AJAX - by Leo - 04-14-2020, 03:40 PM
RE: CSRF regenerate with AJAX - by Gary - 04-14-2020, 06:49 PM
RE: CSRF regenerate with AJAX - by Leo - 04-14-2020, 11:34 PM
RE: CSRF regenerate with AJAX - by entis - 04-15-2020, 08:02 AM
RE: CSRF regenerate with AJAX - by Gary - 04-15-2020, 12:09 PM
RE: CSRF regenerate with AJAX - by Leo - 04-15-2020, 12:30 PM
RE: CSRF regenerate with AJAX - by Morgun_Andrey - 05-05-2020, 02:39 PM
RE: CSRF regenerate with AJAX - by Gary - 04-15-2020, 01:17 PM
RE: CSRF regenerate with AJAX - by 007basaran - 02-06-2023, 08:46 PM
RE: CSRF regenerate with AJAX - by SubrataJ - 02-06-2023, 10:44 PM
RE: CSRF regenerate with AJAX - by Leo - 02-07-2023, 01:06 PM
RE: CSRF regenerate with AJAX - by Gary - 02-26-2023, 10:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB