S
S
semki0962017-04-27 13:27:21
PHP
semki096, 2017-04-27 13:27:21

Do I need to protect against cross-site request forgery if my form is submitted by Ajax?

Delivered a plug-in from cross-site requests. It generates a token in the form. Everything is working. But I have a form sent by ajax. The problem is that the plugin does not work with it, since it generates tokens once when the page is loaded, respectively, it will work only on the first send, when resubmitted from this page, the plugin will not work because new tokens will not be generated. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Uwe_Boll, 2017-04-27
@semki096

yes, you need to do
this before sending a new response, generate a token using the same means and send it and display it on the client

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question