dframe/token

Token component Dframe

v4.1.8 2022-01-30 11:58 UTC

This package is auto-updated.

Last update: 2024-03-28 15:32:04 UTC


README

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