Skip to content

Instantly share code, notes, and snippets.

@bernard-ng
Created December 23, 2020 13:43
Show Gist options
  • Save bernard-ng/2277e59c5afbb70c95e466abe818fd70 to your computer and use it in GitHub Desktop.
Save bernard-ng/2277e59c5afbb70c95e466abe818fd70 to your computer and use it in GitHub Desktop.
<?php
$middleware = new CsrfMiddleware($_SESSION, 200);
$app->pipe($middleware);
// Generate input
$input = "<input type='hidden' name='{$middleware->getFormKey()}' value='{$middleware->generateToken()}'/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment