I was reading https://dzone.com/articles/cookies-vs-tokens-the-definitive-guide and noticed it says things like:
When using the cookie-based authentication, the back-end has to do a
lookup, whether that be a traditional SQL database or a NoSQL
alternative, and the round trip is likely to take longer compared to
decoding a token. Additionally, since you can store additional data
inside the JWT, such as the user’s permission level, you can save
yourself additional lookup calls to get and process the requested
data.
It also says:
In a cookie based approach, once the request is made, you’d have one
call to the database to verify that the session is valid, another to
get the user data and verify that the user has the role of admin, and
finally a third call to get the data. On the other hand, with a JWT
approach, you can store the user role in the JWT, so once the request
is made and the JWT verified, you can make a single call to the
database to retrieve the orders.
It’s making it sound like you can’t store a JWT in a cookie.
Can’t you store a JWT in either a cookie, or a Bearer token?
Are JWTs not meant to be stored in cookies?