Question · NestJS course · Module 4: Authentication

Session-based vs JWT authentication

What is the main difference between session-based and JWT authentication?

Answer options

  • Session requires storing state on the server, JWT is stateless
  • JWT requires a database, session does not
  • Session only works in browsers, JWT only in APIs
  • There is no difference - they are synonyms

You can check the correct answer by solving this task in the CodeWorlds game.