CSRF/csrf in ci4
- Enable CSRF:
Go to app/Config/Filters.php
Search for public array $methods and replace with:12345public array $methods = ['post' => ['csrf']];
- Use (Just paste under <from>) :
<input type=”hidden” name=”<?= csrf_token() ?>” value=”<?= csrf_hash() ?>” />