@nifrasbcs Here's the code: $token = array(); $token['id'] = $id; $SESSION["encodedScript"] = JWT::encode($token, 'secretserver_key');
Assign the entire encoded script and decode it when you call other APIs. include('jwthelper.php'); $token = JWT::decode($SESSION["encodedScript"], 'secretserverkey'); echo $token->id;
@nifrasbcs
Here's the code:
$token = array();
$token['id'] = $id;
$SESSION["encodedScript"] = JWT::encode($token, 'secretserver_key');
Assign the entire encoded script and decode it when you call other APIs.
include('jwthelper.php');
$token = JWT::decode($SESSION["encodedScript"], 'secretserverkey');
echo $token->id;