PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Slawomir Kaleta   Dframe PHP CSRF Token Library   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Dframe PHP CSRF Token Library
Generate tokens to protect against CSRF attacks
Author: By
Last change:
Date: 3 years ago
Size: 1,286 bytes
 

Contents

Class file image Download

Dframe/Token - Component

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

php framework dframe logo

Composer

$ composer require dframe/token

Standalone


$driver = new \Dframe\Session\Session('sessionName');

/ 
 * $driver Can be any class implements interface \Psr\SimpleCache\CacheInterface 
 */
$token  = new \Dframe\Token\Token($driver); 
$key = $token->generate('evidenceToken')->get('evidenceToken');  // Generate hash
$isValid = $token->isValid('evidenceToken', $key);            // Return true/false
$has = $token->has('evidenceToken');            // Return true/false

License

Open-sourced software licensed under the MIT license