|
|
|
|
|
by dperfect
2792 days ago
|
|
I don’t think of JWT as a replacement for db lookups or storage, but they do provide a convenience in not having to store and manage all sessions in the database[1]. I’ve done it both ways, and as long as you’re careful about a few of the potential security issues with JWT (solve it once, put it in a reusable module), it actually does save a considerable amount of code and complexity on the server side. Also, in my case, "your blacklisting/revocation server goes down" means the whole application is down anyway, so that's kind of a moot point. You may disagree, and there are valid reasons to avoid JWT. I'm just saying that under the right circumstances, it can be useful. [1] The author claims that JWT isn't any easier, but then later says things like "Expiration can be implemented server-side just as well, and many implementations do". That's true, but it is something extra you have to implement yourself, i.e., not easier (for that feature at least). |
|
So just use a session library with expiration implemented, don’t take one without and add it on yourself.