Welcome Guest, Not a member yet? Register   Sign In
Ajax Question
#4

(This post was last modified: 07-01-2017, 07:08 AM by PaulD.)

If you are regenerating the token on each request, and your ajax empties the form for the next submit if successful (such as on a task list, adding a task) on the second submit the form might have a csrf error as the token is now out of date. If it is a single use form, then the way you have done it is fine.

Also this will only work if you js is inline, not in a js file. As I mentioned, I like to keep my js in files not inline, but there is no right or wrong way.

Best wishes,

Paul.
Reply


Messages In This Thread
Ajax Question - by wolfgang1983 - 07-01-2017, 04:28 AM
RE: Ajax Question - by PaulD - 07-01-2017, 05:29 AM
RE: Ajax Question - by wolfgang1983 - 07-01-2017, 05:46 AM
RE: Ajax Question - by PaulD - 07-01-2017, 07:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB