# Minimal protection against CSRF exploit
## Installation
Copy-paste thoses files in /path/of/your/choice
Then, edit your php.ini
:
auto_prepend_file = /path/of/your/choice/bootstrap.php
## Configuration
Be careful: today only
$_POST
are checked. If you want to check$_GET
request, you should change the methodisTokenRequired()
.
You can change the behavior of CSRF protection.
For example, if you want to redirect user to index.php
when token is invalid, you should uncomment the following line
in bootstrap.php
:
// strict mode. You can, for example, uncomment the following line to clean session, redirect and inform user
// $_SESSION = array(); header('Location: "index.php"); exit;
throw $e;
If you want to be more securized, change the MAX_STACK_TOKENS
value:
Csrf::MAX_STACK_TOKENS = 1;