Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 433 Bytes

File metadata and controls

29 lines (22 loc) · 433 Bytes

ocsrf

This is my Implementation of OWasp's CSRF code. Please feel free to comment or make suggestions so I can improve this code.

usage

<?php
  require_once(ocsrf.class.php);
  session_start();

  if (!OCSRF::protect())
  {
    // Do something in the event of suspected CSRF 
  } else {
    // Process Submitted Form Data
  }
?>

<form method="POST">
  <? echo OCSRF::generate_token(); ?>
  ...
</form>