M
M
magary42016-03-30 11:19:12
symfony
magary4, 2016-03-30 11:19:12

Where can I get form_token?


I display the form through symphony and when sending, I see, in addition to the filter_form [ezxform_token] form fields,
in another place I need to send the same form with Ajax. i do

var form = {
            "filter_form[name]": "blabla",
            "filter_form[type]": 0,
            ....
        };

when I submit $form->getErrors() returns me that the token is missing. where can i get it? display the form through
{{ form_label(form.name) }}
{{ form_errors(form.name) }}
{{ form_widget(form.name) }}
for the Ajax version there is no possibility
and what is its meaning at all if the session cookie is passed in the request

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2016-03-31
@magary4

You can read about the meaning, for example here https://learn.javascript.ru/csrf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question