0Pricing
Flask Academy · Lesson

Sessions vs Stateless Tokens

When JWT fits an API better than cookies.

Two Ways to Remember Users

HTTP forgets you between requests. To keep someone logged in, you either store a session on the server or hand the client a signed token.

How Sessions Work

With a session, the server keeps your login state and gives the browser a tiny cookie holding only a session id. Every request, the server looks that id up. 🍪

All lessons in this course

  1. Sessions vs Stateless Tokens
  2. Issue Access Tokens on Login
  3. Protect Endpoints with jwt_required
  4. Refresh Tokens and Expiry
← Back to Flask Academy