What are CSRF Tokens and why are they fundamental in forms?

Asked

Viewed 48 times

0

I just started messing with Laravel and I wanted to know what it is token that is fundamental in the forms

<form action="/contato" method="POST">
  {{csrf_field()}} 
  <label>Nome</label>
  <input type="text" name="nome" placeholder="Nome/Post">
  <button>enviar</button>
</form>
  • 5
  • I want to point out that the linked answer in the question that @Boiprogramador is wrong, has NOTHING TO DO WITH AJAX, CSRF is to help avoid forms coming from other sites to execute requests on your site, however CSRF is not by far an infallible technique, On the contrary, it is quite easy to circumvent it, it is more guaranteed to use a system similar to reCaptcha (there are others), CSRF is only costly to your site in Laravel (Aravel is already disastrous in performance by itself) and it won’t be safe, just avoid attacks coming from things created by those who have no experience.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.