|
|
|
|
|
by jondubois
2735 days ago
|
|
JWT is simpler to implement and more scalable than the sessionId approach so why would you use the more complex solution to get an inferior result? With JWT, you only need to do a single database lookup when the user logs in with their password at the beginning... You don't need to do any other lookup afterwards to reissue the token; just having the old (still valid but soon-to-expire) JWT in memory is enough of a basis to issue a fresh token with an updated expiry. It scales better because if you have multiple servers, they don't need to share a database/datastore to manage sessionIds. |
|