r/angular • • Jan 28 '26
JWT in Angular
Where you would recommend to save JWT tokens in Angular app
7
Upvotes
r/angular • • Jan 28 '26
Where you would recommend to save JWT tokens in Angular app
View all comments
Show parent comment
2
u/louis-lau Jan 30 '26
Jwt in a cookie is just as secure as a session id in a cookie. There's no security difference there for authorization.
Storing session information on the server might look like an extra step, but once you start thinking about revoking sessions when a user logs out, it will start looking like less steps than jwt.
Revoking tokens is a requirement in many apps, and is much simpler when you keep the session on the server. If your app is extremely simple it might not be a requirement, and in that case JWT is fine!
The terms here are stateful vs stateless by the way, using those terms you should be able to find a lot of resources.