Q40: What is the difference between session-based and token-based state storage?

Session authentication stores state server-side (in memory or Redis) mapped to a session ID cookie. Token-based authentication (JWT) stores cryptographically signed state client-side.

Key Takeaways
  • Sessions store state server-side relying on session ID cookies.
  • Tokens store state statelessly within signed user tokens.
Knowledge Check

Which data store is popular for managing distributed server-side sessions?