JWT is meant to allow the exchange of a token that is tamper-proof when a client needs to communicate with the backend. It also serves to avoid making calls to the backend datastore by caching session data in the token.
But I could just as easily encrypt the session data using standard encryption algorithms and sent it back to the client and the client just returns it on each call.
So what have I really gained by using JWT? If anything, putting the type of algorithm in the JWT seems to be a security flaw as it tells a hacker what kind of encryption was used, thus reducing the types of algorithms needed to decrypt the token. By just encoding my session data in some proprietary format (not necessarily JSON) and using even a custom encryption algorithm, wouldn't this be a better solution than using JWT? Or would I be missing out on something by not using JWT?