Cross-site request forgery (also known as CSRF) is a web security vulnerability that allows an attacker to induce users to perform actions that they do not intend to perform. It allows an attacker to partly circumvent the same origin policy, which is designed to prevent different websites from interfering with each other.
More details at:
-
https://owasp.org/www-community/attacks/csrf
This code bellow only works for single form page at once, for example if the use opens 2 tabs and fill two forms at same time only the 1st form will work, the other will fails.