1. Go to this page and download the library: Download ocramius/psr7-csrf library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ocramius / psr7-csrf example snippets
$app = \Zend\Expressive\AppFactory::create();
$app->pipe(\PSR7Session\Http\SessionMiddleware::fromSymmetricKeyDefaults(
'mBC5v1sOKVvbdEitdSBenu59nfNfhwkedkJVNabosTw=', // replace this with a key of your own (see PSR7Session docs)
1200 // 20 minutes session duration
));
$app->pipe(\PSR7Csrf\Factory::createDefaultCSRFCheckerMiddleware());