JWTs are a type of security token that provides a way to securely store and transfer information.
They are made up of two parts:
a JSON object that contains claims about a user,
a header that describes the format of the token.
JWTs are digitally signed and encrypted, making them secure against tampering.
The token is created by serializing the session fields into a JSON object, then encoding the object into a string that acts as the token ID. When presented back to the API, the token is decoded and parsed to recover the session attributes.