Skip to content

freddygreve/FredJWT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

FredJWT - A simple PHP JWT Script

Usage

<?php
include_once dirname(__FILE__) . '/src/FredJWT.php';

// init
$FredJWT = new FredJWT('MySecretKey', 1000); //Set your secret and the expiration time (in seconds)

// Create Token
$userdata = [   //Add some data
  "username" => "Freddy",
  "user_id" => "1234"
];
$token = $FredJWT->create_token($userdata); //create a token with your data

// Verify token
$data = $FredJWT->verify_token($token); //You will get a repsonse with the data and information about the token
?>

Releases

No releases published

Packages

No packages published

Languages