Did you know ... Search Documentation:
csrf.pl -- Protect against cross-site request forgery
PublicShow source

Handlers that change state on behalf of a logged in user call csrf_check/1 before doing anything. We do not use tokens, but verify the request was initiated from our own site. Modern browsers send the Sec-Fetch-Site header, which cannot be set by scripts. For browsers that do not, we fall back to the Origin or Referer header.

Requests without any of these headers are refused. Note that this implies that state-changing links cannot be used from bookmarks or mail, as browsers send Sec-Fetch-Site: none for these.

Source csrf_check(+Request) is det
Raise an HTTP 403 (Forbidden) reply if Request was not initiated from our own site.