dframe/token

Token component Dframe

v4.2.0 2022-10-28 12:21 UTC

This package is auto-updated.

Last update: 2024-11-28 16:56:25 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

php framework dframe logo

Composer

$ composer require dframe/token

Standalone

use Dframe\Session\Session;
use Dframe\Token\Token;

$driver = new Session('sessionName');

/** 
 * $driver Can be any class implements interface \Psr\SimpleCache\CacheInterface 
 */
$token  = new 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