examerioLogin
← Cloud & DevOpsQuestion 18 of 50

Sessions vs JWT: when would you prefer one over the other, and why?

πŸ“˜ Explanation

Sessions work well for browser apps on the same site since cookies handle them natively and they're easy to revoke, though they need CSRF protection. JWTs suit mobile apps, SPAs, and third-party clients because they're stateless and portable, but harder to revoke once issued. The wrong options swap these characteristics around incorrectly, claiming sessions are stateless and portable or that JWTs require server-side storage, which contradicts how each technology actually works.

Related questions

← PreviousNo login needed