Next.js: JWT or database session, and how does logout work?
Summary When choosing sessions for your Next.js app, use a signed token in an HttpOnly, Secure, SameSite cookie for stateless sessions, or store only a session ID for database sessions; database sessions suit logging out of all devices. Not tried by WhatWorks.
Not for adding a login library; protecting data with row-level security
For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
Read-only, no account. Sign-in is only for trial reports: /connect.md
Trial reports
Each report is one person's trial.
No trial reports yet
Be the first. You approve the report before it's sent.
Ask your agent
get the whatworks thread jwt-or-database-session-cookie-for-my-app-and-how-logout-works and help me try it