PHP code example of hardywen / cookie-csrf

1. Go to this page and download the library: Download hardywen/cookie-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/ */

    

hardywen / cookie-csrf example snippets


//路由白名单,pattern通过的就调用此filter,用于设定哪些链接调用
    'white_list' => array(
        '*'
    ),

    //路由黑名单,pattern通过的就【不】调用此filter,用于排除哪些链接调用
    'black_list' => array(
        'orders/notify/*' // 支付回调之类的外站调用本站接口链接
    ),

    'method' => array(
        'post',
        'put',
        'delete'
    )

 php artisan config:publish hardywen/cookie-csrf