M
M
magary42017-01-18 19:40:13
symfony
magary4, 2017-01-18 19:40:13

Csrf protection without form component?

if i render simple html form
in controller logic like:
$db->delete("user_favorite_articles")->where(["id"=>$request->get("id"), "user_id"=>$this ->getCurrentUser()->id);
what about security in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2017-01-18
@prototype_denis

api.symfony.com/3.1/Symfony/Component/Security/Csr...
This is not a forms component. This is the Security component.
This token is needed so that your forms are not "hijacked" - you guarantee with it that the request was made from the page of your host. (Of course, if the keys are not compromised)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question