How to Prevent Cross-site Request Forgery (CSRF) – Generic Tips Step 1: Train and maintain awareness. ... Step 2: Assess the risk. ... Step 3: Use anti-CSRF tokens. ... Step 4: Use SameSite cookies. ... Step 5: Scan regularly (with Acunetix)