2017 © Pedro Peláez
 

library csrf-token

hoangnamitc.com

image

hoangnamitc/csrf-token

hoangnamitc.com

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 15 % Grown

The README.md

csrf-token

Class Anti Security CSRF TOKEN

This project is available on Packagist, and installation via Composer is the recommended way to install csrf-token. Just add this line to your composer.json file:, (*1)

"hoangnamitc/csrf-token": "~2.0"

or run, (*2)

composer require hoangnamitc/csrf-token

Installing

require 'token.class.php';

or via composer, (*3)

require 'vendor/autoload.php';

Usage

  • Initial
$token = new \hoangnamitc\Token('token_name');
  • Choose times create token after refresh
$token->set();        // Token create one times
$token->set('*', 10); // Token create with time lives is 10 second
$token->set('*');     // Token create many times, created continuity.
  • Get name Token
$token->getName();
  • Get value of Token:
$token->getToken();
  • Validate Token
if ( $token->validate($token_value) ) {
    // Valid
} else {
    // invalid
}
  • Detele token curently
$token->delete();
  • Debug code
$token->debug();

~~$token->deleteAll()~~, (*4)

Authors

hoangnamitc, (*5)

The Versions

17/04 2018

dev-master

9999999-dev https://github.com/hoangnamitc/csrf-token

hoangnamitc.com

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

php security token csrf hoangnamitc

17/04 2018

v2.0.1

2.0.1.0 https://github.com/hoangnamitc/csrf-token

hoangnamitc.com

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

php security token csrf hoangnamitc

04/04 2018

2.0

2.0.0.0 https://github.com/hoangnamitc/csrf-token

hoangnamitc.com

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

security token csrf hoangnamitc